<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span id="local-6989586621679685491"></span><span class="hs-pragma">{-# LANGUAGE DeriveFunctor #-}</span><span>
</span><span id="line-2"></span><span class="hs-pragma">{-# LANGUAGE FlexibleContexts #-}</span><span>
</span><span id="line-3"></span><span class="hs-pragma">{-# LANGUAGE RankNTypes #-}</span><span>
</span><span id="line-4"></span><span>
</span><span id="line-5"></span><span class="hs-comment">-----------------------------------------------------------------------------</span><span>
</span><span id="line-6"></span><span class="hs-comment">-- |</span><span>
</span><span id="line-7"></span><span class="hs-comment">-- Module      :  Distribution.Simple.Glob</span><span>
</span><span id="line-8"></span><span class="hs-comment">-- Copyright   :  Isaac Jones, Simon Marlow 2003-2004</span><span>
</span><span id="line-9"></span><span class="hs-comment">-- License     :  BSD3</span><span>
</span><span id="line-10"></span><span class="hs-comment">--                portions Copyright (c) 2007, Galois Inc.</span><span>
</span><span id="line-11"></span><span class="hs-comment">--</span><span>
</span><span id="line-12"></span><span class="hs-comment">-- Maintainer  :  cabal-devel@haskell.org</span><span>
</span><span id="line-13"></span><span class="hs-comment">-- Portability :  portable</span><span>
</span><span id="line-14"></span><span class="hs-comment">--</span><span>
</span><span id="line-15"></span><span class="hs-comment">-- Simple file globbing.</span><span>
</span><span id="line-16"></span><span>
</span><span id="line-17"></span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">Distribution.Simple.Glob</span><span> </span><span class="hs-special">(</span><span>
</span><span id="line-18"></span><span>        </span><span class="annot"><a href="Distribution.Simple.Glob.html#GlobSyntaxError"><span class="hs-identifier">GlobSyntaxError</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-19"></span><span>        </span><span class="annot"><a href="Distribution.Simple.Glob.html#GlobResult"><span class="hs-identifier">GlobResult</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-20"></span><span>        </span><span class="annot"><a href="Distribution.Simple.Glob.html#matchDirFileGlob"><span class="hs-identifier">matchDirFileGlob</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-21"></span><span>        </span><span class="annot"><a href="Distribution.Simple.Glob.html#runDirFileGlob"><span class="hs-identifier">runDirFileGlob</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-22"></span><span>        </span><span class="annot"><a href="Distribution.Simple.Glob.html#fileGlobMatches"><span class="hs-identifier">fileGlobMatches</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-23"></span><span>        </span><span class="annot"><a href="Distribution.Simple.Glob.html#parseFileGlob"><span class="hs-identifier">parseFileGlob</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-24"></span><span>        </span><span class="annot"><a href="Distribution.Simple.Glob.html#explainGlobSyntaxError"><span class="hs-identifier">explainGlobSyntaxError</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-25"></span><span>        </span><span class="annot"><a href="Distribution.Simple.Glob.html#Glob"><span class="hs-identifier">Glob</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-26"></span><span>  </span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-27"></span><span>
</span><span id="line-28"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Prelude.html#"><span class="hs-identifier">Prelude</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-29"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Distribution.Compat.Prelude.html"><span class="hs-identifier">Distribution.Compat.Prelude</span></a></span><span>
</span><span id="line-30"></span><span>
</span><span id="line-31"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Distribution.CabalSpecVersion.html"><span class="hs-identifier">Distribution.CabalSpecVersion</span></a></span><span>
</span><span id="line-32"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Distribution.Simple.Utils.html"><span class="hs-identifier">Distribution.Simple.Utils</span></a></span><span>
</span><span id="line-33"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Distribution.Verbosity.html"><span class="hs-identifier">Distribution.Verbosity</span></a></span><span>
</span><span id="line-34"></span><span>
</span><span id="line-35"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../directory/src/System.Directory.html#"><span class="hs-identifier">System.Directory</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../directory/src/System.Directory.html#getDirectoryContents"><span class="hs-identifier">getDirectoryContents</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../directory/src/System.Directory.html#doesDirectoryExist"><span class="hs-identifier">doesDirectoryExist</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../directory/src/System.Directory.html#doesFileExist"><span class="hs-identifier">doesFileExist</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-36"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../filepath/src/System.FilePath.html#"><span class="hs-identifier">System.FilePath</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../filepath/src/System.FilePath.Windows.html#joinPath"><span class="hs-identifier">joinPath</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../filepath/src/System.FilePath.Windows.html#splitExtensions"><span class="hs-identifier">splitExtensions</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../filepath/src/System.FilePath.Windows.html#splitDirectories"><span class="hs-identifier">splitDirectories</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../filepath/src/System.FilePath.Windows.html#takeFileName"><span class="hs-identifier">takeFileName</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../filepath/src/System.FilePath.Windows.html#%3C%2F%3E"><span class="hs-operator">(&lt;/&gt;)</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../filepath/src/System.FilePath.Windows.html#%3C.%3E"><span class="hs-operator">(&lt;.&gt;)</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-37"></span><span>
</span><span id="line-38"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="../../base/src/Data.List.NonEmpty.html#"><span class="hs-identifier">Data.List.NonEmpty</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">NE</span></span><span>
</span><span id="line-39"></span><span>
</span><span id="line-40"></span><span class="hs-comment">-- Note throughout that we use splitDirectories, not splitPath. On</span><span>
</span><span id="line-41"></span><span class="hs-comment">-- Posix, this makes no difference, but, because Windows accepts both</span><span>
</span><span id="line-42"></span><span class="hs-comment">-- slash and backslash as its path separators, if we left in the</span><span>
</span><span id="line-43"></span><span class="hs-comment">-- separators from the glob we might not end up properly normalised.</span><span>
</span><span id="line-44"></span><span>
</span><span id="line-45"></span><span class="hs-keyword">data</span><span> </span><span id="GlobResult"><span class="annot"><a href="Distribution.Simple.Glob.html#GlobResult"><span class="hs-identifier hs-var">GlobResult</span></a></span></span><span> </span><span id="local-6989586621679685576"><span class="annot"><a href="#local-6989586621679685576"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-46"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span id="GlobMatch"><span class="annot"><a href="Distribution.Simple.Glob.html#GlobMatch"><span class="hs-identifier hs-var">GlobMatch</span></a></span></span><span> </span><span class="annot"><a href="#local-6989586621679685576"><span class="hs-identifier hs-type">a</span></a></span><span>
</span><span id="line-47"></span><span>    </span><span class="hs-comment">-- ^ The glob matched the value supplied.</span><span>
</span><span id="line-48"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span id="GlobWarnMultiDot"><span class="annot"><a href="Distribution.Simple.Glob.html#GlobWarnMultiDot"><span class="hs-identifier hs-var">GlobWarnMultiDot</span></a></span></span><span> </span><span class="annot"><a href="#local-6989586621679685576"><span class="hs-identifier hs-type">a</span></a></span><span>
</span><span id="line-49"></span><span>    </span><span class="hs-comment">-- ^ The glob did not match the value supplied because the</span><span>
</span><span id="line-50"></span><span>    </span><span class="hs-comment">--   cabal-version is too low and the extensions on the file did</span><span>
</span><span id="line-51"></span><span>    </span><span class="hs-comment">--   not precisely match the glob's extensions, but rather the</span><span>
</span><span id="line-52"></span><span>    </span><span class="hs-comment">--   glob was a proper suffix of the file's extensions; i.e., if</span><span>
</span><span id="line-53"></span><span>    </span><span class="hs-comment">--   not for the low cabal-version, it would have matched.</span><span>
</span><span id="line-54"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span id="GlobMissingDirectory"><span class="annot"><a href="Distribution.Simple.Glob.html#GlobMissingDirectory"><span class="hs-identifier hs-var">GlobMissingDirectory</span></a></span></span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span>
</span><span id="line-55"></span><span>    </span><span class="hs-comment">-- ^ The glob couldn't match because the directory named doesn't</span><span>
</span><span id="line-56"></span><span>    </span><span class="hs-comment">--   exist. The directory will be as it appears in the glob (i.e.,</span><span>
</span><span id="line-57"></span><span>    </span><span class="hs-comment">--   relative to the directory passed to 'matchDirFileGlob', and,</span><span>
</span><span id="line-58"></span><span>    </span><span class="hs-comment">--   for 'data-files', relative to 'data-dir').</span><span>
</span><span id="line-59"></span><span>  </span><span class="hs-keyword">deriving</span><span> </span><span class="hs-special">(</span><span id="local-6989586621679685393"><span id="local-6989586621679685395"><span id="local-6989586621679685406"><span class="annot"><span class="annottext">Int -&gt; GlobResult a -&gt; ShowS
[GlobResult a] -&gt; ShowS
GlobResult a -&gt; String
(Int -&gt; GlobResult a -&gt; ShowS)
-&gt; (GlobResult a -&gt; String)
-&gt; ([GlobResult a] -&gt; ShowS)
-&gt; Show (GlobResult a)
forall a. Show a =&gt; Int -&gt; GlobResult a -&gt; ShowS
forall a. Show a =&gt; [GlobResult a] -&gt; ShowS
forall a. Show a =&gt; GlobResult a -&gt; String
forall a.
(Int -&gt; a -&gt; ShowS) -&gt; (a -&gt; String) -&gt; ([a] -&gt; ShowS) -&gt; Show a
showList :: [GlobResult a] -&gt; ShowS
$cshowList :: forall a. Show a =&gt; [GlobResult a] -&gt; ShowS
show :: GlobResult a -&gt; String
$cshow :: forall a. Show a =&gt; GlobResult a -&gt; String
showsPrec :: Int -&gt; GlobResult a -&gt; ShowS
$cshowsPrec :: forall a. Show a =&gt; Int -&gt; GlobResult a -&gt; ShowS
</span><a href="../../base/src/GHC.Show.html#Show"><span class="hs-identifier hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var">Show</span></a></span></span></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679685384"><span id="local-6989586621679685389"><span class="annot"><span class="annottext">GlobResult a -&gt; GlobResult a -&gt; Bool
(GlobResult a -&gt; GlobResult a -&gt; Bool)
-&gt; (GlobResult a -&gt; GlobResult a -&gt; Bool) -&gt; Eq (GlobResult a)
forall a. Eq a =&gt; GlobResult a -&gt; GlobResult a -&gt; Bool
forall a. (a -&gt; a -&gt; Bool) -&gt; (a -&gt; a -&gt; Bool) -&gt; Eq a
/= :: GlobResult a -&gt; GlobResult a -&gt; Bool
$c/= :: forall a. Eq a =&gt; GlobResult a -&gt; GlobResult a -&gt; Bool
== :: GlobResult a -&gt; GlobResult a -&gt; Bool
$c== :: forall a. Eq a =&gt; GlobResult a -&gt; GlobResult a -&gt; Bool
</span><span class="hs-identifier hs-var hs-var hs-var hs-var hs-var hs-var">Eq</span></span></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679685355"><span id="local-6989586621679685357"><span id="local-6989586621679685360"><span id="local-6989586621679685363"><span id="local-6989586621679685366"><span id="local-6989586621679685372"><span id="local-6989586621679685379"><span class="annot"><span class="annottext">Eq (GlobResult a)
Eq (GlobResult a)
-&gt; (GlobResult a -&gt; GlobResult a -&gt; Ordering)
-&gt; (GlobResult a -&gt; GlobResult a -&gt; Bool)
-&gt; (GlobResult a -&gt; GlobResult a -&gt; Bool)
-&gt; (GlobResult a -&gt; GlobResult a -&gt; Bool)
-&gt; (GlobResult a -&gt; GlobResult a -&gt; Bool)
-&gt; (GlobResult a -&gt; GlobResult a -&gt; GlobResult a)
-&gt; (GlobResult a -&gt; GlobResult a -&gt; GlobResult a)
-&gt; Ord (GlobResult a)
GlobResult a -&gt; GlobResult a -&gt; Bool
GlobResult a -&gt; GlobResult a -&gt; Ordering
GlobResult a -&gt; GlobResult a -&gt; GlobResult a
forall a.
Eq a
-&gt; (a -&gt; a -&gt; Ordering)
-&gt; (a -&gt; a -&gt; Bool)
-&gt; (a -&gt; a -&gt; Bool)
-&gt; (a -&gt; a -&gt; Bool)
-&gt; (a -&gt; a -&gt; Bool)
-&gt; (a -&gt; a -&gt; a)
-&gt; (a -&gt; a -&gt; a)
-&gt; Ord a
forall {a}. Ord a =&gt; Eq (GlobResult a)
forall a. Ord a =&gt; GlobResult a -&gt; GlobResult a -&gt; Bool
forall a. Ord a =&gt; GlobResult a -&gt; GlobResult a -&gt; Ordering
forall a. Ord a =&gt; GlobResult a -&gt; GlobResult a -&gt; GlobResult a
min :: GlobResult a -&gt; GlobResult a -&gt; GlobResult a
$cmin :: forall a. Ord a =&gt; GlobResult a -&gt; GlobResult a -&gt; GlobResult a
max :: GlobResult a -&gt; GlobResult a -&gt; GlobResult a
$cmax :: forall a. Ord a =&gt; GlobResult a -&gt; GlobResult a -&gt; GlobResult a
&gt;= :: GlobResult a -&gt; GlobResult a -&gt; Bool
$c&gt;= :: forall a. Ord a =&gt; GlobResult a -&gt; GlobResult a -&gt; Bool
&gt; :: GlobResult a -&gt; GlobResult a -&gt; Bool
$c&gt; :: forall a. Ord a =&gt; GlobResult a -&gt; GlobResult a -&gt; Bool
&lt;= :: GlobResult a -&gt; GlobResult a -&gt; Bool
$c&lt;= :: forall a. Ord a =&gt; GlobResult a -&gt; GlobResult a -&gt; Bool
&lt; :: GlobResult a -&gt; GlobResult a -&gt; Bool
$c&lt; :: forall a. Ord a =&gt; GlobResult a -&gt; GlobResult a -&gt; Bool
compare :: GlobResult a -&gt; GlobResult a -&gt; Ordering
$ccompare :: forall a. Ord a =&gt; GlobResult a -&gt; GlobResult a -&gt; Ordering
</span><span class="hs-identifier hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var">Ord</span></span></span></span></span></span></span></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679685349"><span id="local-6989586621679685351"><span class="annot"><span class="annottext">(forall a b. (a -&gt; b) -&gt; GlobResult a -&gt; GlobResult b)
-&gt; (forall a b. a -&gt; GlobResult b -&gt; GlobResult a)
-&gt; Functor GlobResult
forall a b. a -&gt; GlobResult b -&gt; GlobResult a
forall a b. (a -&gt; b) -&gt; GlobResult a -&gt; GlobResult b
forall (f :: * -&gt; *).
(forall a b. (a -&gt; b) -&gt; f a -&gt; f b)
-&gt; (forall a b. a -&gt; f b -&gt; f a) -&gt; Functor f
&lt;$ :: forall a b. a -&gt; GlobResult b -&gt; GlobResult a
$c&lt;$ :: forall a b. a -&gt; GlobResult b -&gt; GlobResult a
fmap :: forall a b. (a -&gt; b) -&gt; GlobResult a -&gt; GlobResult b
$cfmap :: forall a b. (a -&gt; b) -&gt; GlobResult a -&gt; GlobResult b
</span><a href="../../base/src/GHC.Base.html#Functor"><span class="hs-identifier hs-var hs-var hs-var hs-var hs-var hs-var">Functor</span></a></span></span></span><span class="hs-special">)</span><span>
</span><span id="line-60"></span><span>
</span><span id="line-61"></span><span class="hs-comment">-- | Extract the matches from a list of 'GlobResult's.</span><span>
</span><span id="line-62"></span><span class="hs-comment">--</span><span>
</span><span id="line-63"></span><span class="hs-comment">-- Note: throws away the 'GlobMissingDirectory' results; chances are</span><span>
</span><span id="line-64"></span><span class="hs-comment">-- that you want to check for these and error out if any are present.</span><span>
</span><span id="line-65"></span><span id="local-6989586621679685561"><span class="annot"><a href="Distribution.Simple.Glob.html#globMatches"><span class="hs-identifier hs-type">globMatches</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="Distribution.Simple.Glob.html#GlobResult"><span class="hs-identifier hs-type">GlobResult</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679685561"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="#local-6989586621679685561"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">]</span></span><span>
</span><span id="line-66"></span><span id="globMatches"><span class="annot"><span class="annottext">globMatches :: forall a. [GlobResult a] -&gt; [a]
</span><a href="Distribution.Simple.Glob.html#globMatches"><span class="hs-identifier hs-var hs-var">globMatches</span></a></span></span><span> </span><span id="local-6989586621679685346"><span class="annot"><span class="annottext">[GlobResult a]
</span><a href="#local-6989586621679685346"><span class="hs-identifier hs-var">input</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679685345"><span class="hs-identifier hs-var">a</span></a></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="Distribution.Simple.Glob.html#GlobMatch"><span class="hs-identifier hs-type">GlobMatch</span></a></span><span> </span><span id="local-6989586621679685345"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679685345"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[GlobResult a]
</span><a href="#local-6989586621679685346"><span class="hs-identifier hs-var">input</span></a></span><span> </span><span class="hs-special">]</span><span>
</span><span id="line-67"></span><span>
</span><span id="line-68"></span><span class="hs-keyword">data</span><span> </span><span id="GlobSyntaxError"><span class="annot"><a href="Distribution.Simple.Glob.html#GlobSyntaxError"><span class="hs-identifier hs-var">GlobSyntaxError</span></a></span></span><span>
</span><span id="line-69"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span id="StarInDirectory"><span class="annot"><a href="Distribution.Simple.Glob.html#StarInDirectory"><span class="hs-identifier hs-var">StarInDirectory</span></a></span></span><span>
</span><span id="line-70"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span id="StarInFileName"><span class="annot"><a href="Distribution.Simple.Glob.html#StarInFileName"><span class="hs-identifier hs-var">StarInFileName</span></a></span></span><span>
</span><span id="line-71"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span id="StarInExtension"><span class="annot"><a href="Distribution.Simple.Glob.html#StarInExtension"><span class="hs-identifier hs-var">StarInExtension</span></a></span></span><span>
</span><span id="line-72"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span id="NoExtensionOnStar"><span class="annot"><a href="Distribution.Simple.Glob.html#NoExtensionOnStar"><span class="hs-identifier hs-var">NoExtensionOnStar</span></a></span></span><span>
</span><span id="line-73"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span id="EmptyGlob"><span class="annot"><a href="Distribution.Simple.Glob.html#EmptyGlob"><span class="hs-identifier hs-var">EmptyGlob</span></a></span></span><span>
</span><span id="line-74"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span id="LiteralFileNameGlobStar"><span class="annot"><a href="Distribution.Simple.Glob.html#LiteralFileNameGlobStar"><span class="hs-identifier hs-var">LiteralFileNameGlobStar</span></a></span></span><span>
</span><span id="line-75"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span id="VersionDoesNotSupportGlobStar"><span class="annot"><a href="Distribution.Simple.Glob.html#VersionDoesNotSupportGlobStar"><span class="hs-identifier hs-var">VersionDoesNotSupportGlobStar</span></a></span></span><span>
</span><span id="line-76"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span id="VersionDoesNotSupportGlob"><span class="annot"><a href="Distribution.Simple.Glob.html#VersionDoesNotSupportGlob"><span class="hs-identifier hs-var">VersionDoesNotSupportGlob</span></a></span></span><span>
</span><span id="line-77"></span><span>  </span><span class="hs-keyword">deriving</span><span> </span><span class="hs-special">(</span><span id="local-6989586621679685333"><span id="local-6989586621679685335"><span class="annot"><span class="annottext">GlobSyntaxError -&gt; GlobSyntaxError -&gt; Bool
(GlobSyntaxError -&gt; GlobSyntaxError -&gt; Bool)
-&gt; (GlobSyntaxError -&gt; GlobSyntaxError -&gt; Bool)
-&gt; Eq GlobSyntaxError
forall a. (a -&gt; a -&gt; Bool) -&gt; (a -&gt; a -&gt; Bool) -&gt; Eq a
/= :: GlobSyntaxError -&gt; GlobSyntaxError -&gt; Bool
$c/= :: GlobSyntaxError -&gt; GlobSyntaxError -&gt; Bool
== :: GlobSyntaxError -&gt; GlobSyntaxError -&gt; Bool
$c== :: GlobSyntaxError -&gt; GlobSyntaxError -&gt; Bool
</span><span class="hs-identifier hs-var hs-var hs-var hs-var hs-var hs-var">Eq</span></span></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679685327"><span id="local-6989586621679685329"><span id="local-6989586621679685331"><span class="annot"><span class="annottext">Int -&gt; GlobSyntaxError -&gt; ShowS
[GlobSyntaxError] -&gt; ShowS
GlobSyntaxError -&gt; String
(Int -&gt; GlobSyntaxError -&gt; ShowS)
-&gt; (GlobSyntaxError -&gt; String)
-&gt; ([GlobSyntaxError] -&gt; ShowS)
-&gt; Show GlobSyntaxError
forall a.
(Int -&gt; a -&gt; ShowS) -&gt; (a -&gt; String) -&gt; ([a] -&gt; ShowS) -&gt; Show a
showList :: [GlobSyntaxError] -&gt; ShowS
$cshowList :: [GlobSyntaxError] -&gt; ShowS
show :: GlobSyntaxError -&gt; String
$cshow :: GlobSyntaxError -&gt; String
showsPrec :: Int -&gt; GlobSyntaxError -&gt; ShowS
$cshowsPrec :: Int -&gt; GlobSyntaxError -&gt; ShowS
</span><a href="../../base/src/GHC.Show.html#Show"><span class="hs-identifier hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var">Show</span></a></span></span></span></span><span class="hs-special">)</span><span>
</span><span id="line-78"></span><span>
</span><span id="line-79"></span><span class="annot"><a href="Distribution.Simple.Glob.html#explainGlobSyntaxError"><span class="hs-identifier hs-type">explainGlobSyntaxError</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Simple.Glob.html#GlobSyntaxError"><span class="hs-identifier hs-type">GlobSyntaxError</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span>
</span><span id="line-80"></span><span id="explainGlobSyntaxError"><span class="annot"><span class="annottext">explainGlobSyntaxError :: String -&gt; GlobSyntaxError -&gt; String
</span><a href="Distribution.Simple.Glob.html#explainGlobSyntaxError"><span class="hs-identifier hs-var hs-var">explainGlobSyntaxError</span></a></span></span><span> </span><span id="local-6989586621679685326"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679685326"><span class="hs-identifier hs-var">filepath</span></a></span></span><span> </span><span class="annot"><span class="annottext">GlobSyntaxError
</span><a href="Distribution.Simple.Glob.html#StarInDirectory"><span class="hs-identifier hs-var">StarInDirectory</span></a></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-81"></span><span>     </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;invalid file glob '&quot;</span></span><span> </span><span class="annot"><span class="annottext">String -&gt; ShowS
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679685326"><span class="hs-identifier hs-var">filepath</span></a></span><span>
</span><span id="line-82"></span><span>  </span><span class="annot"><span class="annottext">String -&gt; ShowS
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;'. A wildcard '**' is only allowed as the final parent&quot;</span></span><span>
</span><span id="line-83"></span><span>  </span><span class="annot"><span class="annottext">String -&gt; ShowS
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot; directory. Stars must not otherwise appear in the parent&quot;</span></span><span>
</span><span id="line-84"></span><span>  </span><span class="annot"><span class="annottext">String -&gt; ShowS
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot; directories.&quot;</span></span><span>
</span><span id="line-85"></span><span class="annot"><a href="Distribution.Simple.Glob.html#explainGlobSyntaxError"><span class="hs-identifier hs-var">explainGlobSyntaxError</span></a></span><span> </span><span id="local-6989586621679685325"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679685325"><span class="hs-identifier hs-var">filepath</span></a></span></span><span> </span><span class="annot"><span class="annottext">GlobSyntaxError
</span><a href="Distribution.Simple.Glob.html#StarInExtension"><span class="hs-identifier hs-var">StarInExtension</span></a></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-86"></span><span>     </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;invalid file glob '&quot;</span></span><span> </span><span class="annot"><span class="annottext">String -&gt; ShowS
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679685325"><span class="hs-identifier hs-var">filepath</span></a></span><span>
</span><span id="line-87"></span><span>  </span><span class="annot"><span class="annottext">String -&gt; ShowS
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;'. Wildcards '*' are only allowed as the&quot;</span></span><span>
</span><span id="line-88"></span><span>  </span><span class="annot"><span class="annottext">String -&gt; ShowS
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot; file's base name, not in the file extension.&quot;</span></span><span>
</span><span id="line-89"></span><span class="annot"><a href="Distribution.Simple.Glob.html#explainGlobSyntaxError"><span class="hs-identifier hs-var">explainGlobSyntaxError</span></a></span><span> </span><span id="local-6989586621679685324"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679685324"><span class="hs-identifier hs-var">filepath</span></a></span></span><span> </span><span class="annot"><span class="annottext">GlobSyntaxError
</span><a href="Distribution.Simple.Glob.html#StarInFileName"><span class="hs-identifier hs-var">StarInFileName</span></a></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-90"></span><span>     </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;invalid file glob '&quot;</span></span><span> </span><span class="annot"><span class="annottext">String -&gt; ShowS
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679685324"><span class="hs-identifier hs-var">filepath</span></a></span><span>
</span><span id="line-91"></span><span>  </span><span class="annot"><span class="annottext">String -&gt; ShowS
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;'. Wildcards '*' may only totally replace the&quot;</span></span><span>
</span><span id="line-92"></span><span>  </span><span class="annot"><span class="annottext">String -&gt; ShowS
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot; file's base name, not only parts of it.&quot;</span></span><span>
</span><span id="line-93"></span><span class="annot"><a href="Distribution.Simple.Glob.html#explainGlobSyntaxError"><span class="hs-identifier hs-var">explainGlobSyntaxError</span></a></span><span> </span><span id="local-6989586621679685323"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679685323"><span class="hs-identifier hs-var">filepath</span></a></span></span><span> </span><span class="annot"><span class="annottext">GlobSyntaxError
</span><a href="Distribution.Simple.Glob.html#NoExtensionOnStar"><span class="hs-identifier hs-var">NoExtensionOnStar</span></a></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-94"></span><span>     </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;invalid file glob '&quot;</span></span><span> </span><span class="annot"><span class="annottext">String -&gt; ShowS
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679685323"><span class="hs-identifier hs-var">filepath</span></a></span><span>
</span><span id="line-95"></span><span>  </span><span class="annot"><span class="annottext">String -&gt; ShowS
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;'. If a wildcard '*' is used it must be with an file extension.&quot;</span></span><span>
</span><span id="line-96"></span><span class="annot"><a href="Distribution.Simple.Glob.html#explainGlobSyntaxError"><span class="hs-identifier hs-var">explainGlobSyntaxError</span></a></span><span> </span><span id="local-6989586621679685322"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679685322"><span class="hs-identifier hs-var">filepath</span></a></span></span><span> </span><span class="annot"><span class="annottext">GlobSyntaxError
</span><a href="Distribution.Simple.Glob.html#LiteralFileNameGlobStar"><span class="hs-identifier hs-var">LiteralFileNameGlobStar</span></a></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-97"></span><span>     </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;invalid file glob '&quot;</span></span><span> </span><span class="annot"><span class="annottext">String -&gt; ShowS
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679685322"><span class="hs-identifier hs-var">filepath</span></a></span><span>
</span><span id="line-98"></span><span>  </span><span class="annot"><span class="annottext">String -&gt; ShowS
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;'. If a wildcard '**' is used as a parent directory, the&quot;</span></span><span>
</span><span id="line-99"></span><span>  </span><span class="annot"><span class="annottext">String -&gt; ShowS
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot; file's base name must be a wildcard '*'.&quot;</span></span><span>
</span><span id="line-100"></span><span class="annot"><a href="Distribution.Simple.Glob.html#explainGlobSyntaxError"><span class="hs-identifier hs-var">explainGlobSyntaxError</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">GlobSyntaxError
</span><a href="Distribution.Simple.Glob.html#EmptyGlob"><span class="hs-identifier hs-var">EmptyGlob</span></a></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-101"></span><span>     </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;invalid file glob. A glob cannot be the empty string.&quot;</span></span><span>
</span><span id="line-102"></span><span class="annot"><a href="Distribution.Simple.Glob.html#explainGlobSyntaxError"><span class="hs-identifier hs-var">explainGlobSyntaxError</span></a></span><span> </span><span id="local-6989586621679685321"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679685321"><span class="hs-identifier hs-var">filepath</span></a></span></span><span> </span><span class="annot"><span class="annottext">GlobSyntaxError
</span><a href="Distribution.Simple.Glob.html#VersionDoesNotSupportGlobStar"><span class="hs-identifier hs-var">VersionDoesNotSupportGlobStar</span></a></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-103"></span><span>     </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;invalid file glob '&quot;</span></span><span> </span><span class="annot"><span class="annottext">String -&gt; ShowS
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679685321"><span class="hs-identifier hs-var">filepath</span></a></span><span>
</span><span id="line-104"></span><span>  </span><span class="annot"><span class="annottext">String -&gt; ShowS
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;'. Using the double-star syntax requires 'cabal-version: 2.4'&quot;</span></span><span>
</span><span id="line-105"></span><span>  </span><span class="annot"><span class="annottext">String -&gt; ShowS
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot; or greater. Alternatively, for compatibility with earlier Cabal&quot;</span></span><span>
</span><span id="line-106"></span><span>  </span><span class="annot"><span class="annottext">String -&gt; ShowS
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot; versions, list the included directories explicitly.&quot;</span></span><span>
</span><span id="line-107"></span><span class="annot"><a href="Distribution.Simple.Glob.html#explainGlobSyntaxError"><span class="hs-identifier hs-var">explainGlobSyntaxError</span></a></span><span> </span><span id="local-6989586621679685320"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679685320"><span class="hs-identifier hs-var">filepath</span></a></span></span><span> </span><span class="annot"><span class="annottext">GlobSyntaxError
</span><a href="Distribution.Simple.Glob.html#VersionDoesNotSupportGlob"><span class="hs-identifier hs-var">VersionDoesNotSupportGlob</span></a></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-108"></span><span>     </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;invalid file glob '&quot;</span></span><span> </span><span class="annot"><span class="annottext">String -&gt; ShowS
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679685320"><span class="hs-identifier hs-var">filepath</span></a></span><span>
</span><span id="line-109"></span><span>  </span><span class="annot"><span class="annottext">String -&gt; ShowS
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;'. Using star wildcards requires 'cabal-version: &gt;= 1.6'. &quot;</span></span><span>
</span><span id="line-110"></span><span>  </span><span class="annot"><span class="annottext">String -&gt; ShowS
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Alternatively if you require compatibility with earlier Cabal &quot;</span></span><span>
</span><span id="line-111"></span><span>  </span><span class="annot"><span class="annottext">String -&gt; ShowS
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;versions then list all the files explicitly.&quot;</span></span><span>
</span><span id="line-112"></span><span>
</span><span id="line-113"></span><span class="hs-keyword">data</span><span> </span><span id="IsRecursive"><span class="annot"><a href="Distribution.Simple.Glob.html#IsRecursive"><span class="hs-identifier hs-var">IsRecursive</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="Recursive"><span class="annot"><a href="Distribution.Simple.Glob.html#Recursive"><span class="hs-identifier hs-var">Recursive</span></a></span></span><span> </span><span class="hs-glyph">|</span><span> </span><span id="NonRecursive"><span class="annot"><a href="Distribution.Simple.Glob.html#NonRecursive"><span class="hs-identifier hs-var">NonRecursive</span></a></span></span><span>
</span><span id="line-114"></span><span>
</span><span id="line-115"></span><span class="hs-keyword">data</span><span> </span><span id="MultiDot"><span class="annot"><a href="Distribution.Simple.Glob.html#MultiDot"><span class="hs-identifier hs-var">MultiDot</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="MultiDotDisabled"><span class="annot"><a href="Distribution.Simple.Glob.html#MultiDotDisabled"><span class="hs-identifier hs-var">MultiDotDisabled</span></a></span></span><span> </span><span class="hs-glyph">|</span><span> </span><span id="MultiDotEnabled"><span class="annot"><a href="Distribution.Simple.Glob.html#MultiDotEnabled"><span class="hs-identifier hs-var">MultiDotEnabled</span></a></span></span><span>
</span><span id="line-116"></span><span>
</span><span id="line-117"></span><span class="hs-keyword">data</span><span> </span><span id="Glob"><span class="annot"><a href="Distribution.Simple.Glob.html#Glob"><span class="hs-identifier hs-var">Glob</span></a></span></span><span>
</span><span id="line-118"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span id="GlobStem"><span class="annot"><a href="Distribution.Simple.Glob.html#GlobStem"><span class="hs-identifier hs-var">GlobStem</span></a></span></span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span> </span><span class="annot"><a href="Distribution.Simple.Glob.html#Glob"><span class="hs-identifier hs-type">Glob</span></a></span><span>
</span><span id="line-119"></span><span>    </span><span class="hs-comment">-- ^ A single subdirectory component + remainder.</span><span>
</span><span id="line-120"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span id="GlobFinal"><span class="annot"><a href="Distribution.Simple.Glob.html#GlobFinal"><span class="hs-identifier hs-var">GlobFinal</span></a></span></span><span> </span><span class="annot"><a href="Distribution.Simple.Glob.html#GlobFinal"><span class="hs-identifier hs-type">GlobFinal</span></a></span><span>
</span><span id="line-121"></span><span>
</span><span id="line-122"></span><span class="hs-keyword">data</span><span> </span><span id="GlobFinal"><span class="annot"><a href="Distribution.Simple.Glob.html#GlobFinal"><span class="hs-identifier hs-var">GlobFinal</span></a></span></span><span>
</span><span id="line-123"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span id="FinalMatch"><span class="annot"><a href="Distribution.Simple.Glob.html#FinalMatch"><span class="hs-identifier hs-var">FinalMatch</span></a></span></span><span> </span><span class="annot"><a href="Distribution.Simple.Glob.html#IsRecursive"><span class="hs-identifier hs-type">IsRecursive</span></a></span><span> </span><span class="annot"><a href="Distribution.Simple.Glob.html#MultiDot"><span class="hs-identifier hs-type">MultiDot</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span>
</span><span id="line-124"></span><span>    </span><span class="hs-comment">-- ^ First argument: Is this a @**/*.ext@ pattern?</span><span>
</span><span id="line-125"></span><span>    </span><span class="hs-comment">--   Second argument: should we match against the exact extensions, or accept a suffix?</span><span>
</span><span id="line-126"></span><span>    </span><span class="hs-comment">--   Third argument: the extensions to accept.</span><span>
</span><span id="line-127"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span id="FinalLit"><span class="annot"><a href="Distribution.Simple.Glob.html#FinalLit"><span class="hs-identifier hs-var">FinalLit</span></a></span></span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span>
</span><span id="line-128"></span><span>    </span><span class="hs-comment">-- ^ Literal file name.</span><span>
</span><span id="line-129"></span><span>
</span><span id="line-130"></span><span class="annot"><a href="Distribution.Simple.Glob.html#reconstructGlob"><span class="hs-identifier hs-type">reconstructGlob</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Simple.Glob.html#Glob"><span class="hs-identifier hs-type">Glob</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span>
</span><span id="line-131"></span><span id="reconstructGlob"><span class="annot"><span class="annottext">reconstructGlob :: Glob -&gt; String
</span><a href="Distribution.Simple.Glob.html#reconstructGlob"><span class="hs-identifier hs-var hs-var">reconstructGlob</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Simple.Glob.html#GlobStem"><span class="hs-identifier hs-type">GlobStem</span></a></span><span> </span><span id="local-6989586621679685310"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679685310"><span class="hs-identifier hs-var">dir</span></a></span></span><span> </span><span id="local-6989586621679685309"><span class="annot"><span class="annottext">Glob
</span><a href="#local-6989586621679685309"><span class="hs-identifier hs-var">glob</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-132"></span><span>  </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679685310"><span class="hs-identifier hs-var">dir</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; ShowS
</span><a href="../../filepath/src/System.FilePath.Windows.html#%3C%2F%3E"><span class="hs-operator hs-var">&lt;/&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Glob -&gt; String
</span><a href="Distribution.Simple.Glob.html#reconstructGlob"><span class="hs-identifier hs-var">reconstructGlob</span></a></span><span> </span><span class="annot"><span class="annottext">Glob
</span><a href="#local-6989586621679685309"><span class="hs-identifier hs-var">glob</span></a></span><span>
</span><span id="line-133"></span><span class="annot"><a href="Distribution.Simple.Glob.html#reconstructGlob"><span class="hs-identifier hs-var">reconstructGlob</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Simple.Glob.html#GlobFinal"><span class="hs-identifier hs-type">GlobFinal</span></a></span><span> </span><span id="local-6989586621679685308"><span class="annot"><span class="annottext">GlobFinal
</span><a href="#local-6989586621679685308"><span class="hs-identifier hs-var">final</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">GlobFinal
</span><a href="#local-6989586621679685308"><span class="hs-identifier hs-var">final</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-134"></span><span>  </span><span class="annot"><a href="Distribution.Simple.Glob.html#FinalMatch"><span class="hs-identifier hs-type">FinalMatch</span></a></span><span> </span><span class="annot"><span class="annottext">IsRecursive
</span><a href="Distribution.Simple.Glob.html#Recursive"><span class="hs-identifier hs-var">Recursive</span></a></span><span> </span><span class="annot"><span class="annottext">MultiDot
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621679685307"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679685307"><span class="hs-identifier hs-var">exts</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;**&quot;</span></span><span> </span><span class="annot"><span class="annottext">String -&gt; ShowS
</span><a href="../../filepath/src/System.FilePath.Windows.html#%3C%2F%3E"><span class="hs-operator hs-var">&lt;/&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;*&quot;</span></span><span> </span><span class="annot"><span class="annottext">String -&gt; ShowS
</span><a href="../../filepath/src/System.FilePath.Windows.html#%3C.%3E"><span class="hs-operator hs-var">&lt;.&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679685307"><span class="hs-identifier hs-var">exts</span></a></span><span>
</span><span id="line-135"></span><span>  </span><span class="annot"><a href="Distribution.Simple.Glob.html#FinalMatch"><span class="hs-identifier hs-type">FinalMatch</span></a></span><span> </span><span class="annot"><span class="annottext">IsRecursive
</span><a href="Distribution.Simple.Glob.html#NonRecursive"><span class="hs-identifier hs-var">NonRecursive</span></a></span><span> </span><span class="annot"><span class="annottext">MultiDot
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621679685306"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679685306"><span class="hs-identifier hs-var">exts</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;*&quot;</span></span><span> </span><span class="annot"><span class="annottext">String -&gt; ShowS
</span><a href="../../filepath/src/System.FilePath.Windows.html#%3C.%3E"><span class="hs-operator hs-var">&lt;.&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679685306"><span class="hs-identifier hs-var">exts</span></a></span><span>
</span><span id="line-136"></span><span>  </span><span class="annot"><a href="Distribution.Simple.Glob.html#FinalLit"><span class="hs-identifier hs-type">FinalLit</span></a></span><span> </span><span id="local-6989586621679685305"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679685305"><span class="hs-identifier hs-var">path</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679685305"><span class="hs-identifier hs-var">path</span></a></span><span>
</span><span id="line-137"></span><span>
</span><span id="line-138"></span><span class="hs-comment">-- | Returns 'Nothing' if the glob didn't match at all, or 'Just' the</span><span>
</span><span id="line-139"></span><span class="hs-comment">--   result if the glob matched (or would have matched with a higher</span><span>
</span><span id="line-140"></span><span class="hs-comment">--   cabal-version).</span><span>
</span><span id="line-141"></span><span class="annot"><a href="Distribution.Simple.Glob.html#fileGlobMatches"><span class="hs-identifier hs-type">fileGlobMatches</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Simple.Glob.html#Glob"><span class="hs-identifier hs-type">Glob</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Simple.Glob.html#GlobResult"><span class="hs-identifier hs-type">GlobResult</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-142"></span><span id="fileGlobMatches"><span class="annot"><span class="annottext">fileGlobMatches :: Glob -&gt; String -&gt; Maybe (GlobResult String)
</span><a href="Distribution.Simple.Glob.html#fileGlobMatches"><span class="hs-identifier hs-var hs-var">fileGlobMatches</span></a></span></span><span> </span><span id="local-6989586621679685304"><span class="annot"><span class="annottext">Glob
</span><a href="#local-6989586621679685304"><span class="hs-identifier hs-var">pat</span></a></span></span><span> </span><span id="local-6989586621679685303"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679685303"><span class="hs-identifier hs-var">candidate</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-143"></span><span>  </span><span id="local-6989586621679685302"><span class="annot"><span class="annottext">GlobResult ()
</span><a href="#local-6989586621679685302"><span class="hs-identifier hs-var">match</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Glob -&gt; [String] -&gt; Maybe (GlobResult ())
</span><a href="Distribution.Simple.Glob.html#fileGlobMatchesSegments"><span class="hs-identifier hs-var">fileGlobMatchesSegments</span></a></span><span> </span><span class="annot"><span class="annottext">Glob
</span><a href="#local-6989586621679685304"><span class="hs-identifier hs-var">pat</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; [String]
</span><a href="../../filepath/src/System.FilePath.Windows.html#splitDirectories"><span class="hs-identifier hs-var">splitDirectories</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679685303"><span class="hs-identifier hs-var">candidate</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-144"></span><span>  </span><span class="annot"><span class="annottext">GlobResult String -&gt; Maybe (GlobResult String)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679685303"><span class="hs-identifier hs-var">candidate</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; GlobResult () -&gt; GlobResult String
forall (f :: * -&gt; *) a b. Functor f =&gt; a -&gt; f b -&gt; f a
</span><a href="../../base/src/GHC.Base.html#%3C%24"><span class="hs-operator hs-var">&lt;$</span></a></span><span> </span><span class="annot"><span class="annottext">GlobResult ()
</span><a href="#local-6989586621679685302"><span class="hs-identifier hs-var">match</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-145"></span><span>
</span><span id="line-146"></span><span class="annot"><a href="Distribution.Simple.Glob.html#fileGlobMatchesSegments"><span class="hs-identifier hs-type">fileGlobMatchesSegments</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Simple.Glob.html#Glob"><span class="hs-identifier hs-type">Glob</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Simple.Glob.html#GlobResult"><span class="hs-identifier hs-type">GlobResult</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-147"></span><span id="fileGlobMatchesSegments"><span class="annot"><span class="annottext">fileGlobMatchesSegments :: Glob -&gt; [String] -&gt; Maybe (GlobResult ())
</span><a href="Distribution.Simple.Glob.html#fileGlobMatchesSegments"><span class="hs-identifier hs-var hs-var">fileGlobMatchesSegments</span></a></span></span><span> </span><span class="annot"><span class="annottext">Glob
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe (GlobResult ())
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-148"></span><span class="annot"><a href="Distribution.Simple.Glob.html#fileGlobMatchesSegments"><span class="hs-identifier hs-var">fileGlobMatchesSegments</span></a></span><span> </span><span id="local-6989586621679685299"><span class="annot"><span class="annottext">Glob
</span><a href="#local-6989586621679685299"><span class="hs-identifier hs-var">pat</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679685298"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679685298"><span class="hs-identifier hs-var">seg</span></a></span></span><span> </span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span> </span><span id="local-6989586621679685297"><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679685297"><span class="hs-identifier hs-var">segs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Glob
</span><a href="#local-6989586621679685299"><span class="hs-identifier hs-var">pat</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-149"></span><span>  </span><span class="annot"><a href="Distribution.Simple.Glob.html#GlobStem"><span class="hs-identifier hs-type">GlobStem</span></a></span><span> </span><span id="local-6989586621679685296"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679685296"><span class="hs-identifier hs-var">dir</span></a></span></span><span> </span><span id="local-6989586621679685295"><span class="annot"><span class="annottext">Glob
</span><a href="#local-6989586621679685295"><span class="hs-identifier hs-var">pat'</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-150"></span><span>    </span><span class="annot"><span class="annottext">Bool -&gt; Maybe ()
forall (f :: * -&gt; *). Alternative f =&gt; Bool -&gt; f ()
</span><a href="../../base/src/Control.Monad.html#guard"><span class="hs-identifier hs-var">guard</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679685296"><span class="hs-identifier hs-var">dir</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679685298"><span class="hs-identifier hs-var">seg</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-151"></span><span>    </span><span class="annot"><span class="annottext">Glob -&gt; [String] -&gt; Maybe (GlobResult ())
</span><a href="Distribution.Simple.Glob.html#fileGlobMatchesSegments"><span class="hs-identifier hs-var">fileGlobMatchesSegments</span></a></span><span> </span><span class="annot"><span class="annottext">Glob
</span><a href="#local-6989586621679685295"><span class="hs-identifier hs-var">pat'</span></a></span><span> </span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679685297"><span class="hs-identifier hs-var">segs</span></a></span><span>
</span><span id="line-152"></span><span>  </span><span class="annot"><a href="Distribution.Simple.Glob.html#GlobFinal"><span class="hs-identifier hs-type">GlobFinal</span></a></span><span> </span><span id="local-6989586621679685294"><span class="annot"><span class="annottext">GlobFinal
</span><a href="#local-6989586621679685294"><span class="hs-identifier hs-var">final</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">GlobFinal
</span><a href="#local-6989586621679685294"><span class="hs-identifier hs-var">final</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-153"></span><span>    </span><span class="annot"><a href="Distribution.Simple.Glob.html#FinalMatch"><span class="hs-identifier hs-type">FinalMatch</span></a></span><span> </span><span class="annot"><span class="annottext">IsRecursive
</span><a href="Distribution.Simple.Glob.html#Recursive"><span class="hs-identifier hs-var">Recursive</span></a></span><span> </span><span id="local-6989586621679685293"><span class="annot"><span class="annottext">MultiDot
</span><a href="#local-6989586621679685293"><span class="hs-identifier hs-var">multidot</span></a></span></span><span> </span><span id="local-6989586621679685292"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679685292"><span class="hs-identifier hs-var">ext</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-154"></span><span>      </span><span class="hs-keyword">let</span><span> </span><span class="hs-special">(</span><span id="local-6989586621679685291"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679685291"><span class="hs-identifier hs-var">candidateBase</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679685290"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679685290"><span class="hs-identifier hs-var">candidateExts</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; (String, String)
</span><a href="../../filepath/src/System.FilePath.Windows.html#splitExtensions"><span class="hs-identifier hs-var">splitExtensions</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">NonEmpty String -&gt; String
forall a. NonEmpty a -&gt; a
</span><a href="../../base/src/Data.List.NonEmpty.html#last"><span class="hs-identifier hs-var">NE.last</span></a></span><span> </span><span class="annot"><span class="annottext">(NonEmpty String -&gt; String) -&gt; NonEmpty String -&gt; String
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679685298"><span class="hs-identifier hs-var">seg</span></a></span><span class="annot"><span class="annottext">String -&gt; [String] -&gt; NonEmpty String
forall a. a -&gt; [a] -&gt; NonEmpty a
</span><a href="../../base/src/GHC.Base.html#%3A%7C"><span class="hs-operator hs-var">:|</span></a></span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679685297"><span class="hs-identifier hs-var">segs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-155"></span><span>      </span><span class="annot"><span class="annottext">Bool -&gt; Maybe ()
forall (f :: * -&gt; *). Alternative f =&gt; Bool -&gt; f ()
</span><a href="../../base/src/Control.Monad.html#guard"><span class="hs-identifier hs-var">guard</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Bool -&gt; Bool
</span><span class="hs-identifier hs-var">not</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; Bool
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#null"><span class="hs-identifier hs-var">null</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679685291"><span class="hs-identifier hs-var">candidateBase</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-156"></span><span>      </span><span class="annot"><span class="annottext">MultiDot -&gt; String -&gt; String -&gt; Maybe (GlobResult ())
</span><a href="Distribution.Simple.Glob.html#checkExt"><span class="hs-identifier hs-var">checkExt</span></a></span><span> </span><span class="annot"><span class="annottext">MultiDot
</span><a href="#local-6989586621679685293"><span class="hs-identifier hs-var">multidot</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679685292"><span class="hs-identifier hs-var">ext</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679685290"><span class="hs-identifier hs-var">candidateExts</span></a></span><span>
</span><span id="line-157"></span><span>    </span><span class="annot"><a href="Distribution.Simple.Glob.html#FinalMatch"><span class="hs-identifier hs-type">FinalMatch</span></a></span><span> </span><span class="annot"><span class="annottext">IsRecursive
</span><a href="Distribution.Simple.Glob.html#NonRecursive"><span class="hs-identifier hs-var">NonRecursive</span></a></span><span> </span><span id="local-6989586621679685284"><span class="annot"><span class="annottext">MultiDot
</span><a href="#local-6989586621679685284"><span class="hs-identifier hs-var">multidot</span></a></span></span><span> </span><span id="local-6989586621679685283"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679685283"><span class="hs-identifier hs-var">ext</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-158"></span><span>      </span><span class="hs-keyword">let</span><span> </span><span class="hs-special">(</span><span id="local-6989586621679685282"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679685282"><span class="hs-identifier hs-var">candidateBase</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679685281"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679685281"><span class="hs-identifier hs-var">candidateExts</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; (String, String)
</span><a href="../../filepath/src/System.FilePath.Windows.html#splitExtensions"><span class="hs-identifier hs-var">splitExtensions</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679685298"><span class="hs-identifier hs-var">seg</span></a></span><span>
</span><span id="line-159"></span><span>      </span><span class="annot"><span class="annottext">Bool -&gt; Maybe ()
forall (f :: * -&gt; *). Alternative f =&gt; Bool -&gt; f ()
</span><a href="../../base/src/Control.Monad.html#guard"><span class="hs-identifier hs-var">guard</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[String] -&gt; Bool
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#null"><span class="hs-identifier hs-var">null</span></a></span><span> </span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679685297"><span class="hs-identifier hs-var">segs</span></a></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">&amp;&amp;</span></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool
</span><span class="hs-identifier hs-var">not</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; Bool
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#null"><span class="hs-identifier hs-var">null</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679685282"><span class="hs-identifier hs-var">candidateBase</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-160"></span><span>      </span><span class="annot"><span class="annottext">MultiDot -&gt; String -&gt; String -&gt; Maybe (GlobResult ())
</span><a href="Distribution.Simple.Glob.html#checkExt"><span class="hs-identifier hs-var">checkExt</span></a></span><span> </span><span class="annot"><span class="annottext">MultiDot
</span><a href="#local-6989586621679685284"><span class="hs-identifier hs-var">multidot</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679685283"><span class="hs-identifier hs-var">ext</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679685281"><span class="hs-identifier hs-var">candidateExts</span></a></span><span>
</span><span id="line-161"></span><span>    </span><span class="annot"><a href="Distribution.Simple.Glob.html#FinalLit"><span class="hs-identifier hs-type">FinalLit</span></a></span><span> </span><span id="local-6989586621679685279"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679685279"><span class="hs-identifier hs-var">filename</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-162"></span><span>      </span><span class="annot"><span class="annottext">Bool -&gt; Maybe ()
forall (f :: * -&gt; *). Alternative f =&gt; Bool -&gt; f ()
</span><a href="../../base/src/Control.Monad.html#guard"><span class="hs-identifier hs-var">guard</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[String] -&gt; Bool
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#null"><span class="hs-identifier hs-var">null</span></a></span><span> </span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679685297"><span class="hs-identifier hs-var">segs</span></a></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">&amp;&amp;</span></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679685279"><span class="hs-identifier hs-var">filename</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679685298"><span class="hs-identifier hs-var">seg</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-163"></span><span>      </span><span class="annot"><span class="annottext">GlobResult () -&gt; Maybe (GlobResult ())
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">() -&gt; GlobResult ()
forall a. a -&gt; GlobResult a
</span><a href="Distribution.Simple.Glob.html#GlobMatch"><span class="hs-identifier hs-var">GlobMatch</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-164"></span><span>
</span><span id="line-165"></span><span class="annot"><a href="Distribution.Simple.Glob.html#checkExt"><span class="hs-identifier hs-type">checkExt</span></a></span><span>
</span><span id="line-166"></span><span>  </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Simple.Glob.html#MultiDot"><span class="hs-identifier hs-type">MultiDot</span></a></span><span>
</span><span id="line-167"></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-comment">-- ^ The pattern's extension</span><span>
</span><span id="line-168"></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-comment">-- ^ The candidate file's extension</span><span>
</span><span id="line-169"></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Simple.Glob.html#GlobResult"><span class="hs-identifier hs-type">GlobResult</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-170"></span><span id="checkExt"><span class="annot"><span class="annottext">checkExt :: MultiDot -&gt; String -&gt; String -&gt; Maybe (GlobResult ())
</span><a href="Distribution.Simple.Glob.html#checkExt"><span class="hs-identifier hs-var hs-var">checkExt</span></a></span></span><span> </span><span id="local-6989586621679685278"><span class="annot"><span class="annottext">MultiDot
</span><a href="#local-6989586621679685278"><span class="hs-identifier hs-var">multidot</span></a></span></span><span> </span><span id="local-6989586621679685277"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679685277"><span class="hs-identifier hs-var">ext</span></a></span></span><span> </span><span id="local-6989586621679685276"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679685276"><span class="hs-identifier hs-var">candidate</span></a></span></span><span>
</span><span id="line-171"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679685277"><span class="hs-identifier hs-var">ext</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679685276"><span class="hs-identifier hs-var">candidate</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">GlobResult () -&gt; Maybe (GlobResult ())
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">() -&gt; GlobResult ()
forall a. a -&gt; GlobResult a
</span><a href="Distribution.Simple.Glob.html#GlobMatch"><span class="hs-identifier hs-var">GlobMatch</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-172"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679685277"><span class="hs-identifier hs-var">ext</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; Bool
forall a. Eq a =&gt; [a] -&gt; [a] -&gt; Bool
</span><a href="../../base/src/Data.OldList.html#isSuffixOf"><span class="hs-operator hs-var">`isSuffixOf`</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679685276"><span class="hs-identifier hs-var">candidate</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">MultiDot
</span><a href="#local-6989586621679685278"><span class="hs-identifier hs-var">multidot</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-173"></span><span>      </span><span class="annot"><span class="annottext">MultiDot
</span><a href="Distribution.Simple.Glob.html#MultiDotDisabled"><span class="hs-identifier hs-var">MultiDotDisabled</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">GlobResult () -&gt; Maybe (GlobResult ())
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">() -&gt; GlobResult ()
forall a. a -&gt; GlobResult a
</span><a href="Distribution.Simple.Glob.html#GlobWarnMultiDot"><span class="hs-identifier hs-var">GlobWarnMultiDot</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-174"></span><span>      </span><span class="annot"><span class="annottext">MultiDot
</span><a href="Distribution.Simple.Glob.html#MultiDotEnabled"><span class="hs-identifier hs-var">MultiDotEnabled</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">GlobResult () -&gt; Maybe (GlobResult ())
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">() -&gt; GlobResult ()
forall a. a -&gt; GlobResult a
</span><a href="Distribution.Simple.Glob.html#GlobMatch"><span class="hs-identifier hs-var">GlobMatch</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-175"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe (GlobResult ())
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-176"></span><span>
</span><span id="line-177"></span><span class="annot"><a href="Distribution.Simple.Glob.html#parseFileGlob"><span class="hs-identifier hs-type">parseFileGlob</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.CabalSpecVersion.html#CabalSpecVersion"><span class="hs-identifier hs-type">CabalSpecVersion</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/Data.Either.html#Either"><span class="hs-identifier hs-type">Either</span></a></span><span> </span><span class="annot"><a href="Distribution.Simple.Glob.html#GlobSyntaxError"><span class="hs-identifier hs-type">GlobSyntaxError</span></a></span><span> </span><span class="annot"><a href="Distribution.Simple.Glob.html#Glob"><span class="hs-identifier hs-type">Glob</span></a></span><span>
</span><span id="line-178"></span><span id="parseFileGlob"><span class="annot"><span class="annottext">parseFileGlob :: CabalSpecVersion -&gt; String -&gt; Either GlobSyntaxError Glob
</span><a href="Distribution.Simple.Glob.html#parseFileGlob"><span class="hs-identifier hs-var hs-var">parseFileGlob</span></a></span></span><span> </span><span id="local-6989586621679685274"><span class="annot"><span class="annottext">CabalSpecVersion
</span><a href="#local-6989586621679685274"><span class="hs-identifier hs-var">version</span></a></span></span><span> </span><span id="local-6989586621679685273"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679685273"><span class="hs-identifier hs-var">filepath</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">[String] -&gt; [String]
forall a. [a] -&gt; [a]
</span><a href="../../base/src/GHC.List.html#reverse"><span class="hs-identifier hs-var">reverse</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; [String]
</span><a href="../../filepath/src/System.FilePath.Windows.html#splitDirectories"><span class="hs-identifier hs-var">splitDirectories</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679685273"><span class="hs-identifier hs-var">filepath</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-179"></span><span>  </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-180"></span><span>        </span><span class="annot"><span class="annottext">GlobSyntaxError -&gt; Either GlobSyntaxError Glob
forall a b. a -&gt; Either a b
</span><a href="../../base/src/Data.Either.html#Left"><span class="hs-identifier hs-var">Left</span></a></span><span> </span><span class="annot"><span class="annottext">GlobSyntaxError
</span><a href="Distribution.Simple.Glob.html#EmptyGlob"><span class="hs-identifier hs-var">EmptyGlob</span></a></span><span>
</span><span id="line-181"></span><span>  </span><span class="hs-special">(</span><span id="local-6989586621679685271"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679685271"><span class="hs-identifier hs-var">filename</span></a></span></span><span> </span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;**&quot;</span></span><span> </span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span> </span><span id="local-6989586621679685270"><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679685270"><span class="hs-identifier hs-var">segments</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-182"></span><span>    </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679685269"><span class="hs-identifier hs-var">allowGlobStar</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-183"></span><span>        </span><span id="local-6989586621679685268"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679685268"><span class="hs-identifier hs-var">ext</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">String -&gt; (String, String)
</span><a href="../../filepath/src/System.FilePath.Windows.html#splitExtensions"><span class="hs-identifier hs-var">splitExtensions</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679685271"><span class="hs-identifier hs-var">filename</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-184"></span><span>          </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;*&quot;</span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679685267"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679685267"><span class="hs-identifier hs-var">ext</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'*'</span></span><span> </span><span class="annot"><span class="annottext">Char -&gt; String -&gt; Bool
forall (t :: * -&gt; *) a. (Foldable t, Eq a) =&gt; a -&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#elem"><span class="hs-operator hs-var">`elem`</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679685267"><span class="hs-identifier hs-var">ext</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">GlobSyntaxError -&gt; Either GlobSyntaxError String
forall a b. a -&gt; Either a b
</span><a href="../../base/src/Data.Either.html#Left"><span class="hs-identifier hs-var">Left</span></a></span><span> </span><span class="annot"><span class="annottext">GlobSyntaxError
</span><a href="Distribution.Simple.Glob.html#StarInExtension"><span class="hs-identifier hs-var">StarInExtension</span></a></span><span>
</span><span id="line-185"></span><span>                     </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">String -&gt; Bool
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#null"><span class="hs-identifier hs-var">null</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679685267"><span class="hs-identifier hs-var">ext</span></a></span><span>       </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">GlobSyntaxError -&gt; Either GlobSyntaxError String
forall a b. a -&gt; Either a b
</span><a href="../../base/src/Data.Either.html#Left"><span class="hs-identifier hs-var">Left</span></a></span><span> </span><span class="annot"><span class="annottext">GlobSyntaxError
</span><a href="Distribution.Simple.Glob.html#NoExtensionOnStar"><span class="hs-identifier hs-var">NoExtensionOnStar</span></a></span><span>
</span><span id="line-186"></span><span>                     </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>      </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String -&gt; Either GlobSyntaxError String
forall a b. b -&gt; Either a b
</span><a href="../../base/src/Data.Either.html#Right"><span class="hs-identifier hs-var">Right</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679685267"><span class="hs-identifier hs-var">ext</span></a></span><span>
</span><span id="line-187"></span><span>          </span><span class="annot"><span class="annottext">(String, String)
</span><span class="hs-identifier">_</span></span><span>                           </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">GlobSyntaxError -&gt; Either GlobSyntaxError String
forall a b. a -&gt; Either a b
</span><a href="../../base/src/Data.Either.html#Left"><span class="hs-identifier hs-var">Left</span></a></span><span> </span><span class="annot"><span class="annottext">GlobSyntaxError
</span><a href="Distribution.Simple.Glob.html#LiteralFileNameGlobStar"><span class="hs-identifier hs-var">LiteralFileNameGlobStar</span></a></span><span>
</span><span id="line-188"></span><span>        </span><span class="annot"><span class="annottext">(Glob -&gt; String -&gt; Either GlobSyntaxError Glob)
-&gt; Glob -&gt; [String] -&gt; Either GlobSyntaxError Glob
forall (t :: * -&gt; *) (m :: * -&gt; *) b a.
(Foldable t, Monad m) =&gt;
(b -&gt; a -&gt; m b) -&gt; b -&gt; t a -&gt; m b
</span><a href="../../base/src/Control.Monad.html#foldM"><span class="hs-identifier hs-var">foldM</span></a></span><span> </span><span class="annot"><span class="annottext">Glob -&gt; String -&gt; Either GlobSyntaxError Glob
</span><a href="#local-6989586621679685264"><span class="hs-identifier hs-var">addStem</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">GlobFinal -&gt; Glob
</span><a href="Distribution.Simple.Glob.html#GlobFinal"><span class="hs-identifier hs-var">GlobFinal</span></a></span><span> </span><span class="annot"><span class="annottext">(GlobFinal -&gt; Glob) -&gt; GlobFinal -&gt; Glob
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">IsRecursive -&gt; MultiDot -&gt; String -&gt; GlobFinal
</span><a href="Distribution.Simple.Glob.html#FinalMatch"><span class="hs-identifier hs-var">FinalMatch</span></a></span><span> </span><span class="annot"><span class="annottext">IsRecursive
</span><a href="Distribution.Simple.Glob.html#Recursive"><span class="hs-identifier hs-var">Recursive</span></a></span><span> </span><span class="annot"><span class="annottext">MultiDot
</span><a href="#local-6989586621679685263"><span class="hs-identifier hs-var">multidot</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679685268"><span class="hs-identifier hs-var">ext</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679685270"><span class="hs-identifier hs-var">segments</span></a></span><span>
</span><span id="line-189"></span><span>    </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">GlobSyntaxError -&gt; Either GlobSyntaxError Glob
forall a b. a -&gt; Either a b
</span><a href="../../base/src/Data.Either.html#Left"><span class="hs-identifier hs-var">Left</span></a></span><span> </span><span class="annot"><span class="annottext">GlobSyntaxError
</span><a href="Distribution.Simple.Glob.html#VersionDoesNotSupportGlobStar"><span class="hs-identifier hs-var">VersionDoesNotSupportGlobStar</span></a></span><span>
</span><span id="line-190"></span><span>  </span><span class="hs-special">(</span><span id="local-6989586621679685262"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679685262"><span class="hs-identifier hs-var">filename</span></a></span></span><span> </span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span> </span><span id="local-6989586621679685261"><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679685261"><span class="hs-identifier hs-var">segments</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-191"></span><span>        </span><span id="local-6989586621679685260"><span class="annot"><span class="annottext">GlobFinal
</span><a href="#local-6989586621679685260"><span class="hs-identifier hs-var">pat</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">String -&gt; (String, String)
</span><a href="../../filepath/src/System.FilePath.Windows.html#splitExtensions"><span class="hs-identifier hs-var">splitExtensions</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679685262"><span class="hs-identifier hs-var">filename</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-192"></span><span>          </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;*&quot;</span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679685259"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679685259"><span class="hs-identifier hs-var">ext</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool
</span><span class="hs-identifier hs-var">not</span></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679685258"><span class="hs-identifier hs-var">allowGlob</span></a></span><span>       </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">GlobSyntaxError -&gt; Either GlobSyntaxError GlobFinal
forall a b. a -&gt; Either a b
</span><a href="../../base/src/Data.Either.html#Left"><span class="hs-identifier hs-var">Left</span></a></span><span> </span><span class="annot"><span class="annottext">GlobSyntaxError
</span><a href="Distribution.Simple.Glob.html#VersionDoesNotSupportGlob"><span class="hs-identifier hs-var">VersionDoesNotSupportGlob</span></a></span><span>
</span><span id="line-193"></span><span>                     </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'*'</span></span><span> </span><span class="annot"><span class="annottext">Char -&gt; String -&gt; Bool
forall (t :: * -&gt; *) a. (Foldable t, Eq a) =&gt; a -&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#elem"><span class="hs-operator hs-var">`elem`</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679685259"><span class="hs-identifier hs-var">ext</span></a></span><span>      </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">GlobSyntaxError -&gt; Either GlobSyntaxError GlobFinal
forall a b. a -&gt; Either a b
</span><a href="../../base/src/Data.Either.html#Left"><span class="hs-identifier hs-var">Left</span></a></span><span> </span><span class="annot"><span class="annottext">GlobSyntaxError
</span><a href="Distribution.Simple.Glob.html#StarInExtension"><span class="hs-identifier hs-var">StarInExtension</span></a></span><span>
</span><span id="line-194"></span><span>                     </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">String -&gt; Bool
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#null"><span class="hs-identifier hs-var">null</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679685259"><span class="hs-identifier hs-var">ext</span></a></span><span>            </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">GlobSyntaxError -&gt; Either GlobSyntaxError GlobFinal
forall a b. a -&gt; Either a b
</span><a href="../../base/src/Data.Either.html#Left"><span class="hs-identifier hs-var">Left</span></a></span><span> </span><span class="annot"><span class="annottext">GlobSyntaxError
</span><a href="Distribution.Simple.Glob.html#NoExtensionOnStar"><span class="hs-identifier hs-var">NoExtensionOnStar</span></a></span><span>
</span><span id="line-195"></span><span>                     </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>           </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">GlobFinal -&gt; Either GlobSyntaxError GlobFinal
forall a b. b -&gt; Either a b
</span><a href="../../base/src/Data.Either.html#Right"><span class="hs-identifier hs-var">Right</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">IsRecursive -&gt; MultiDot -&gt; String -&gt; GlobFinal
</span><a href="Distribution.Simple.Glob.html#FinalMatch"><span class="hs-identifier hs-var">FinalMatch</span></a></span><span> </span><span class="annot"><span class="annottext">IsRecursive
</span><a href="Distribution.Simple.Glob.html#NonRecursive"><span class="hs-identifier hs-var">NonRecursive</span></a></span><span> </span><span class="annot"><span class="annottext">MultiDot
</span><a href="#local-6989586621679685263"><span class="hs-identifier hs-var">multidot</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679685259"><span class="hs-identifier hs-var">ext</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-196"></span><span>          </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679685257"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679685257"><span class="hs-identifier hs-var">ext</span></a></span></span><span class="hs-special">)</span><span>   </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'*'</span></span><span> </span><span class="annot"><span class="annottext">Char -&gt; String -&gt; Bool
forall (t :: * -&gt; *) a. (Foldable t, Eq a) =&gt; a -&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#elem"><span class="hs-operator hs-var">`elem`</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679685257"><span class="hs-identifier hs-var">ext</span></a></span><span>      </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">GlobSyntaxError -&gt; Either GlobSyntaxError GlobFinal
forall a b. a -&gt; Either a b
</span><a href="../../base/src/Data.Either.html#Left"><span class="hs-identifier hs-var">Left</span></a></span><span> </span><span class="annot"><span class="annottext">GlobSyntaxError
</span><a href="Distribution.Simple.Glob.html#StarInExtension"><span class="hs-identifier hs-var">StarInExtension</span></a></span><span>
</span><span id="line-197"></span><span>                     </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'*'</span></span><span> </span><span class="annot"><span class="annottext">Char -&gt; String -&gt; Bool
forall (t :: * -&gt; *) a. (Foldable t, Eq a) =&gt; a -&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#elem"><span class="hs-operator hs-var">`elem`</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679685262"><span class="hs-identifier hs-var">filename</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">GlobSyntaxError -&gt; Either GlobSyntaxError GlobFinal
forall a b. a -&gt; Either a b
</span><a href="../../base/src/Data.Either.html#Left"><span class="hs-identifier hs-var">Left</span></a></span><span> </span><span class="annot"><span class="annottext">GlobSyntaxError
</span><a href="Distribution.Simple.Glob.html#StarInFileName"><span class="hs-identifier hs-var">StarInFileName</span></a></span><span>
</span><span id="line-198"></span><span>                     </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>           </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">GlobFinal -&gt; Either GlobSyntaxError GlobFinal
forall a b. b -&gt; Either a b
</span><a href="../../base/src/Data.Either.html#Right"><span class="hs-identifier hs-var">Right</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; GlobFinal
</span><a href="Distribution.Simple.Glob.html#FinalLit"><span class="hs-identifier hs-var">FinalLit</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679685262"><span class="hs-identifier hs-var">filename</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-199"></span><span>        </span><span class="annot"><span class="annottext">(Glob -&gt; String -&gt; Either GlobSyntaxError Glob)
-&gt; Glob -&gt; [String] -&gt; Either GlobSyntaxError Glob
forall (t :: * -&gt; *) (m :: * -&gt; *) b a.
(Foldable t, Monad m) =&gt;
(b -&gt; a -&gt; m b) -&gt; b -&gt; t a -&gt; m b
</span><a href="../../base/src/Control.Monad.html#foldM"><span class="hs-identifier hs-var">foldM</span></a></span><span> </span><span class="annot"><span class="annottext">Glob -&gt; String -&gt; Either GlobSyntaxError Glob
</span><a href="#local-6989586621679685264"><span class="hs-identifier hs-var">addStem</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">GlobFinal -&gt; Glob
</span><a href="Distribution.Simple.Glob.html#GlobFinal"><span class="hs-identifier hs-var">GlobFinal</span></a></span><span> </span><span class="annot"><span class="annottext">GlobFinal
</span><a href="#local-6989586621679685260"><span class="hs-identifier hs-var">pat</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679685261"><span class="hs-identifier hs-var">segments</span></a></span><span>
</span><span id="line-200"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-201"></span><span>    </span><span id="local-6989586621679685258"><span class="annot"><span class="annottext">allowGlob :: Bool
</span><a href="#local-6989586621679685258"><span class="hs-identifier hs-var hs-var">allowGlob</span></a></span></span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CabalSpecVersion
</span><a href="#local-6989586621679685274"><span class="hs-identifier hs-var">version</span></a></span><span> </span><span class="annot"><span class="annottext">CabalSpecVersion -&gt; CabalSpecVersion -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">&gt;=</span></span><span> </span><span class="annot"><span class="annottext">CabalSpecVersion
</span><a href="Distribution.CabalSpecVersion.html#CabalSpecV1_6"><span class="hs-identifier hs-var">CabalSpecV1_6</span></a></span><span>
</span><span id="line-202"></span><span>    </span><span id="local-6989586621679685269"><span class="annot"><span class="annottext">allowGlobStar :: Bool
</span><a href="#local-6989586621679685269"><span class="hs-identifier hs-var hs-var">allowGlobStar</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CabalSpecVersion
</span><a href="#local-6989586621679685274"><span class="hs-identifier hs-var">version</span></a></span><span> </span><span class="annot"><span class="annottext">CabalSpecVersion -&gt; CabalSpecVersion -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">&gt;=</span></span><span> </span><span class="annot"><span class="annottext">CabalSpecVersion
</span><a href="Distribution.CabalSpecVersion.html#CabalSpecV2_4"><span class="hs-identifier hs-var">CabalSpecV2_4</span></a></span><span>
</span><span id="line-203"></span><span>    </span><span id="local-6989586621679685264"><span class="annot"><span class="annottext">addStem :: Glob -&gt; String -&gt; Either GlobSyntaxError Glob
</span><a href="#local-6989586621679685264"><span class="hs-identifier hs-var hs-var">addStem</span></a></span></span><span> </span><span id="local-6989586621679685249"><span class="annot"><span class="annottext">Glob
</span><a href="#local-6989586621679685249"><span class="hs-identifier hs-var">pat</span></a></span></span><span> </span><span id="local-6989586621679685248"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679685248"><span class="hs-identifier hs-var">seg</span></a></span></span><span>
</span><span id="line-204"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'*'</span></span><span> </span><span class="annot"><span class="annottext">Char -&gt; String -&gt; Bool
forall (t :: * -&gt; *) a. (Foldable t, Eq a) =&gt; a -&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#elem"><span class="hs-operator hs-var">`elem`</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679685248"><span class="hs-identifier hs-var">seg</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">GlobSyntaxError -&gt; Either GlobSyntaxError Glob
forall a b. a -&gt; Either a b
</span><a href="../../base/src/Data.Either.html#Left"><span class="hs-identifier hs-var">Left</span></a></span><span> </span><span class="annot"><span class="annottext">GlobSyntaxError
</span><a href="Distribution.Simple.Glob.html#StarInDirectory"><span class="hs-identifier hs-var">StarInDirectory</span></a></span><span>
</span><span id="line-205"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Glob -&gt; Either GlobSyntaxError Glob
forall a b. b -&gt; Either a b
</span><a href="../../base/src/Data.Either.html#Right"><span class="hs-identifier hs-var">Right</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; Glob -&gt; Glob
</span><a href="Distribution.Simple.Glob.html#GlobStem"><span class="hs-identifier hs-var">GlobStem</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679685248"><span class="hs-identifier hs-var">seg</span></a></span><span> </span><span class="annot"><span class="annottext">Glob
</span><a href="#local-6989586621679685249"><span class="hs-identifier hs-var">pat</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-206"></span><span>    </span><span id="local-6989586621679685263"><span class="annot"><span class="annottext">multidot :: MultiDot
</span><a href="#local-6989586621679685263"><span class="hs-identifier hs-var hs-var">multidot</span></a></span></span><span>
</span><span id="line-207"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">CabalSpecVersion
</span><a href="#local-6989586621679685274"><span class="hs-identifier hs-var">version</span></a></span><span> </span><span class="annot"><span class="annottext">CabalSpecVersion -&gt; CabalSpecVersion -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">&gt;=</span></span><span> </span><span class="annot"><span class="annottext">CabalSpecVersion
</span><a href="Distribution.CabalSpecVersion.html#CabalSpecV2_4"><span class="hs-identifier hs-var">CabalSpecV2_4</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">MultiDot
</span><a href="Distribution.Simple.Glob.html#MultiDotEnabled"><span class="hs-identifier hs-var">MultiDotEnabled</span></a></span><span>
</span><span id="line-208"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>                </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">MultiDot
</span><a href="Distribution.Simple.Glob.html#MultiDotDisabled"><span class="hs-identifier hs-var">MultiDotDisabled</span></a></span><span>
</span><span id="line-209"></span><span>
</span><span id="line-210"></span><span class="hs-comment">-- | This will 'die'' when the glob matches no files, or if the glob</span><span>
</span><span id="line-211"></span><span class="hs-comment">-- refers to a missing directory, or if the glob fails to parse.</span><span>
</span><span id="line-212"></span><span class="hs-comment">--</span><span>
</span><span id="line-213"></span><span class="hs-comment">-- The 'Version' argument must be the spec version of the package</span><span>
</span><span id="line-214"></span><span class="hs-comment">-- description being processed, as globs behave slightly differently</span><span>
</span><span id="line-215"></span><span class="hs-comment">-- in different spec versions.</span><span>
</span><span id="line-216"></span><span class="hs-comment">--</span><span>
</span><span id="line-217"></span><span class="hs-comment">-- The first 'FilePath' argument is the directory that the glob is</span><span>
</span><span id="line-218"></span><span class="hs-comment">-- relative to. It must be a valid directory (and hence it can't be</span><span>
</span><span id="line-219"></span><span class="hs-comment">-- the empty string). The returned values will not include this</span><span>
</span><span id="line-220"></span><span class="hs-comment">-- prefix.</span><span>
</span><span id="line-221"></span><span class="hs-comment">--</span><span>
</span><span id="line-222"></span><span class="hs-comment">-- The second 'FilePath' is the glob itself.</span><span>
</span><span id="line-223"></span><span class="annot"><a href="Distribution.Simple.Glob.html#matchDirFileGlob"><span class="hs-identifier hs-type">matchDirFileGlob</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Verbosity.html#Verbosity"><span class="hs-identifier hs-type">Verbosity</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.CabalSpecVersion.html#CabalSpecVersion"><span class="hs-identifier hs-type">CabalSpecVersion</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">[</span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-224"></span><span id="matchDirFileGlob"><span class="annot"><span class="annottext">matchDirFileGlob :: Verbosity -&gt; CabalSpecVersion -&gt; String -&gt; String -&gt; IO [String]
</span><a href="Distribution.Simple.Glob.html#matchDirFileGlob"><span class="hs-identifier hs-var hs-var">matchDirFileGlob</span></a></span></span><span> </span><span id="local-6989586621679685246"><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679685246"><span class="hs-identifier hs-var">verbosity</span></a></span></span><span> </span><span id="local-6989586621679685245"><span class="annot"><span class="annottext">CabalSpecVersion
</span><a href="#local-6989586621679685245"><span class="hs-identifier hs-var">version</span></a></span></span><span> </span><span id="local-6989586621679685244"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679685244"><span class="hs-identifier hs-var">dir</span></a></span></span><span> </span><span id="local-6989586621679685243"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679685243"><span class="hs-identifier hs-var">filepath</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">CabalSpecVersion -&gt; String -&gt; Either GlobSyntaxError Glob
</span><a href="Distribution.Simple.Glob.html#parseFileGlob"><span class="hs-identifier hs-var">parseFileGlob</span></a></span><span> </span><span class="annot"><span class="annottext">CabalSpecVersion
</span><a href="#local-6989586621679685245"><span class="hs-identifier hs-var">version</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679685243"><span class="hs-identifier hs-var">filepath</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-225"></span><span>  </span><span class="annot"><a href="../../base/src/Data.Either.html#Left"><span class="hs-identifier hs-type">Left</span></a></span><span> </span><span id="local-6989586621679685242"><span class="annot"><span class="annottext">GlobSyntaxError
</span><a href="#local-6989586621679685242"><span class="hs-identifier hs-var">err</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Verbosity -&gt; String -&gt; IO [String]
forall a. Verbosity -&gt; String -&gt; IO a
</span><a href="Distribution.Simple.Utils.html#die%27"><span class="hs-identifier hs-var">die'</span></a></span><span> </span><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679685246"><span class="hs-identifier hs-var">verbosity</span></a></span><span> </span><span class="annot"><span class="annottext">(String -&gt; IO [String]) -&gt; String -&gt; IO [String]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; GlobSyntaxError -&gt; String
</span><a href="Distribution.Simple.Glob.html#explainGlobSyntaxError"><span class="hs-identifier hs-var">explainGlobSyntaxError</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679685243"><span class="hs-identifier hs-var">filepath</span></a></span><span> </span><span class="annot"><span class="annottext">GlobSyntaxError
</span><a href="#local-6989586621679685242"><span class="hs-identifier hs-var">err</span></a></span><span>
</span><span id="line-226"></span><span>  </span><span class="annot"><a href="../../base/src/Data.Either.html#Right"><span class="hs-identifier hs-type">Right</span></a></span><span> </span><span id="local-6989586621679685240"><span class="annot"><span class="annottext">Glob
</span><a href="#local-6989586621679685240"><span class="hs-identifier hs-var">glob</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-227"></span><span>    </span><span id="local-6989586621679685239"><span class="annot"><span class="annottext">[GlobResult String]
</span><a href="#local-6989586621679685239"><span class="hs-identifier hs-var">results</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Verbosity -&gt; String -&gt; Glob -&gt; IO [GlobResult String]
</span><a href="Distribution.Simple.Glob.html#runDirFileGlob"><span class="hs-identifier hs-var">runDirFileGlob</span></a></span><span> </span><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679685246"><span class="hs-identifier hs-var">verbosity</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679685244"><span class="hs-identifier hs-var">dir</span></a></span><span> </span><span class="annot"><span class="annottext">Glob
</span><a href="#local-6989586621679685240"><span class="hs-identifier hs-var">glob</span></a></span><span>
</span><span id="line-228"></span><span>    </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621679685238"><span class="annot"><span class="annottext">missingDirectories :: [String]
</span><a href="#local-6989586621679685238"><span class="hs-identifier hs-var hs-var">missingDirectories</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-229"></span><span>          </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679685237"><span class="hs-identifier hs-var">missingDir</span></a></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="Distribution.Simple.Glob.html#GlobMissingDirectory"><span class="hs-identifier hs-type">GlobMissingDirectory</span></a></span><span> </span><span id="local-6989586621679685237"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679685237"><span class="hs-identifier hs-var">missingDir</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[GlobResult String]
</span><a href="#local-6989586621679685239"><span class="hs-identifier hs-var">results</span></a></span><span> </span><span class="hs-special">]</span><span>
</span><span id="line-230"></span><span>        </span><span id="local-6989586621679685236"><span class="annot"><span class="annottext">matches :: [String]
</span><a href="#local-6989586621679685236"><span class="hs-identifier hs-var hs-var">matches</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[GlobResult String] -&gt; [String]
forall a. [GlobResult a] -&gt; [a]
</span><a href="Distribution.Simple.Glob.html#globMatches"><span class="hs-identifier hs-var">globMatches</span></a></span><span> </span><span class="annot"><span class="annottext">[GlobResult String]
</span><a href="#local-6989586621679685239"><span class="hs-identifier hs-var">results</span></a></span><span>
</span><span id="line-231"></span><span>    </span><span class="hs-comment">-- Check for missing directories first, since we'll obviously have</span><span>
</span><span id="line-232"></span><span>    </span><span class="hs-comment">-- no matches in that case.</span><span>
</span><span id="line-233"></span><span>    </span><span class="annot"><span class="annottext">[String] -&gt; (String -&gt; IO Any) -&gt; IO ()
forall (t :: * -&gt; *) (f :: * -&gt; *) a b.
(Foldable t, Applicative f) =&gt;
t a -&gt; (a -&gt; f b) -&gt; f ()
</span><a href="../../base/src/Data.Foldable.html#for_"><span class="hs-identifier hs-var">for_</span></a></span><span> </span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679685238"><span class="hs-identifier hs-var">missingDirectories</span></a></span><span> </span><span class="annot"><span class="annottext">((String -&gt; IO Any) -&gt; IO ()) -&gt; (String -&gt; IO Any) -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span> </span><span id="local-6989586621679685234"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679685234"><span class="hs-identifier hs-var">missingDir</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-234"></span><span>      </span><span class="annot"><span class="annottext">Verbosity -&gt; String -&gt; IO Any
forall a. Verbosity -&gt; String -&gt; IO a
</span><a href="Distribution.Simple.Utils.html#die%27"><span class="hs-identifier hs-var">die'</span></a></span><span> </span><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679685246"><span class="hs-identifier hs-var">verbosity</span></a></span><span> </span><span class="annot"><span class="annottext">(String -&gt; IO Any) -&gt; String -&gt; IO Any
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-235"></span><span>           </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;filepath wildcard '&quot;</span></span><span> </span><span class="annot"><span class="annottext">String -&gt; ShowS
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679685243"><span class="hs-identifier hs-var">filepath</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; ShowS
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;' refers to the directory&quot;</span></span><span>
</span><span id="line-236"></span><span>        </span><span class="annot"><span class="annottext">String -&gt; ShowS
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot; '&quot;</span></span><span> </span><span class="annot"><span class="annottext">String -&gt; ShowS
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679685234"><span class="hs-identifier hs-var">missingDir</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; ShowS
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;', which does not exist or is not a directory.&quot;</span></span><span>
</span><span id="line-237"></span><span>    </span><span class="annot"><span class="annottext">Bool -&gt; IO () -&gt; IO ()
forall (f :: * -&gt; *). Applicative f =&gt; Bool -&gt; f () -&gt; f ()
</span><a href="../../base/src/GHC.Base.html#when"><span class="hs-identifier hs-var">when</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[String] -&gt; Bool
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#null"><span class="hs-identifier hs-var">null</span></a></span><span> </span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679685236"><span class="hs-identifier hs-var">matches</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(IO () -&gt; IO ()) -&gt; IO () -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Verbosity -&gt; String -&gt; IO ()
forall a. Verbosity -&gt; String -&gt; IO a
</span><a href="Distribution.Simple.Utils.html#die%27"><span class="hs-identifier hs-var">die'</span></a></span><span> </span><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679685246"><span class="hs-identifier hs-var">verbosity</span></a></span><span> </span><span class="annot"><span class="annottext">(String -&gt; IO ()) -&gt; String -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-238"></span><span>         </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;filepath wildcard '&quot;</span></span><span> </span><span class="annot"><span class="annottext">String -&gt; ShowS
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679685243"><span class="hs-identifier hs-var">filepath</span></a></span><span>
</span><span id="line-239"></span><span>      </span><span class="annot"><span class="annottext">String -&gt; ShowS
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;' does not match any files.&quot;</span></span><span>
</span><span id="line-240"></span><span>    </span><span class="annot"><span class="annottext">[String] -&gt; IO [String]
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679685236"><span class="hs-identifier hs-var">matches</span></a></span><span>
</span><span id="line-241"></span><span>
</span><span id="line-242"></span><span class="hs-comment">-- | Match files against a pre-parsed glob, starting in a directory.</span><span>
</span><span id="line-243"></span><span class="hs-comment">--</span><span>
</span><span id="line-244"></span><span class="hs-comment">-- The 'Version' argument must be the spec version of the package</span><span>
</span><span id="line-245"></span><span class="hs-comment">-- description being processed, as globs behave slightly differently</span><span>
</span><span id="line-246"></span><span class="hs-comment">-- in different spec versions.</span><span>
</span><span id="line-247"></span><span class="hs-comment">--</span><span>
</span><span id="line-248"></span><span class="hs-comment">-- The 'FilePath' argument is the directory that the glob is relative</span><span>
</span><span id="line-249"></span><span class="hs-comment">-- to. It must be a valid directory (and hence it can't be the empty</span><span>
</span><span id="line-250"></span><span class="hs-comment">-- string). The returned values will not include this prefix.</span><span>
</span><span id="line-251"></span><span class="annot"><a href="Distribution.Simple.Glob.html#runDirFileGlob"><span class="hs-identifier hs-type">runDirFileGlob</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Verbosity.html#Verbosity"><span class="hs-identifier hs-type">Verbosity</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Simple.Glob.html#Glob"><span class="hs-identifier hs-type">Glob</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">[</span><span class="annot"><a href="Distribution.Simple.Glob.html#GlobResult"><span class="hs-identifier hs-type">GlobResult</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-252"></span><span id="runDirFileGlob"><span class="annot"><span class="annottext">runDirFileGlob :: Verbosity -&gt; String -&gt; Glob -&gt; IO [GlobResult String]
</span><a href="Distribution.Simple.Glob.html#runDirFileGlob"><span class="hs-identifier hs-var hs-var">runDirFileGlob</span></a></span></span><span> </span><span id="local-6989586621679685232"><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679685232"><span class="hs-identifier hs-var">verbosity</span></a></span></span><span> </span><span id="local-6989586621679685231"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679685231"><span class="hs-identifier hs-var">rawDir</span></a></span></span><span> </span><span id="local-6989586621679685230"><span class="annot"><span class="annottext">Glob
</span><a href="#local-6989586621679685230"><span class="hs-identifier hs-var">pat</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-253"></span><span>  </span><span class="hs-comment">-- The default data-dir is null. Our callers -should- be</span><span>
</span><span id="line-254"></span><span>  </span><span class="hs-comment">-- converting that to '.' themselves, but it's a certainty that</span><span>
</span><span id="line-255"></span><span>  </span><span class="hs-comment">-- some future call-site will forget and trigger a really</span><span>
</span><span id="line-256"></span><span>  </span><span class="hs-comment">-- hard-to-debug failure if we don't check for that here.</span><span>
</span><span id="line-257"></span><span>  </span><span class="annot"><span class="annottext">Bool -&gt; IO () -&gt; IO ()
forall (f :: * -&gt; *). Applicative f =&gt; Bool -&gt; f () -&gt; f ()
</span><a href="../../base/src/GHC.Base.html#when"><span class="hs-identifier hs-var">when</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; Bool
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#null"><span class="hs-identifier hs-var">null</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679685231"><span class="hs-identifier hs-var">rawDir</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(IO () -&gt; IO ()) -&gt; IO () -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-258"></span><span>    </span><span class="annot"><span class="annottext">Verbosity -&gt; String -&gt; IO ()
</span><a href="Distribution.Simple.Utils.html#warn"><span class="hs-identifier hs-var">warn</span></a></span><span> </span><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679685232"><span class="hs-identifier hs-var">verbosity</span></a></span><span> </span><span class="annot"><span class="annottext">(String -&gt; IO ()) -&gt; String -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-259"></span><span>         </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Null dir passed to runDirFileGlob; interpreting it &quot;</span></span><span>
</span><span id="line-260"></span><span>      </span><span class="annot"><span class="annottext">String -&gt; ShowS
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;as '.'. This is probably an internal error.&quot;</span></span><span>
</span><span id="line-261"></span><span>  </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621679685227"><span class="annot"><span class="annottext">dir :: String
</span><a href="#local-6989586621679685227"><span class="hs-identifier hs-var hs-var">dir</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">String -&gt; Bool
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#null"><span class="hs-identifier hs-var">null</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679685231"><span class="hs-identifier hs-var">rawDir</span></a></span><span> </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;.&quot;</span></span><span> </span><span class="hs-keyword">else</span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679685231"><span class="hs-identifier hs-var">rawDir</span></a></span><span>
</span><span id="line-262"></span><span>  </span><span class="annot"><span class="annottext">Verbosity -&gt; String -&gt; IO ()
</span><a href="Distribution.Simple.Utils.html#debug"><span class="hs-identifier hs-var">debug</span></a></span><span> </span><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679685232"><span class="hs-identifier hs-var">verbosity</span></a></span><span> </span><span class="annot"><span class="annottext">(String -&gt; IO ()) -&gt; String -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Expanding glob '&quot;</span></span><span> </span><span class="annot"><span class="annottext">String -&gt; ShowS
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">Glob -&gt; String
</span><a href="Distribution.Simple.Glob.html#reconstructGlob"><span class="hs-identifier hs-var">reconstructGlob</span></a></span><span> </span><span class="annot"><span class="annottext">Glob
</span><a href="#local-6989586621679685230"><span class="hs-identifier hs-var">pat</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; ShowS
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;' in directory '&quot;</span></span><span> </span><span class="annot"><span class="annottext">String -&gt; ShowS
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679685227"><span class="hs-identifier hs-var">dir</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; ShowS
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;'.&quot;</span></span><span>
</span><span id="line-263"></span><span>  </span><span class="hs-comment">-- This function might be called from the project root with dir as</span><span>
</span><span id="line-264"></span><span>  </span><span class="hs-comment">-- &quot;.&quot;. Walking the tree starting there involves going into .git/</span><span>
</span><span id="line-265"></span><span>  </span><span class="hs-comment">-- and dist-newstyle/, which is a lot of work for no reward, so</span><span>
</span><span id="line-266"></span><span>  </span><span class="hs-comment">-- extract the constant prefix from the pattern and start walking</span><span>
</span><span id="line-267"></span><span>  </span><span class="hs-comment">-- there, and only walk as much as we need to: recursively if **,</span><span>
</span><span id="line-268"></span><span>  </span><span class="hs-comment">-- the whole directory if *, and just the specific file if it's a</span><span>
</span><span id="line-269"></span><span>  </span><span class="hs-comment">-- literal.</span><span>
</span><span id="line-270"></span><span>  </span><span class="hs-keyword">let</span><span> </span><span class="hs-special">(</span><span id="local-6989586621679685225"><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679685225"><span class="hs-identifier hs-var">prefixSegments</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679685224"><span class="annot"><span class="annottext">GlobFinal
</span><a href="#local-6989586621679685224"><span class="hs-identifier hs-var">final</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Glob -&gt; ([String], GlobFinal)
</span><a href="Distribution.Simple.Glob.html#splitConstantPrefix"><span class="hs-identifier hs-var">splitConstantPrefix</span></a></span><span> </span><span class="annot"><span class="annottext">Glob
</span><a href="#local-6989586621679685230"><span class="hs-identifier hs-var">pat</span></a></span><span>
</span><span id="line-271"></span><span>      </span><span id="local-6989586621679685222"><span class="annot"><span class="annottext">joinedPrefix :: String
</span><a href="#local-6989586621679685222"><span class="hs-identifier hs-var hs-var">joinedPrefix</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[String] -&gt; String
</span><a href="../../filepath/src/System.FilePath.Windows.html#joinPath"><span class="hs-identifier hs-var">joinPath</span></a></span><span> </span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679685225"><span class="hs-identifier hs-var">prefixSegments</span></a></span><span>
</span><span id="line-272"></span><span>  </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">GlobFinal
</span><a href="#local-6989586621679685224"><span class="hs-identifier hs-var">final</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-273"></span><span>    </span><span class="annot"><a href="Distribution.Simple.Glob.html#FinalMatch"><span class="hs-identifier hs-type">FinalMatch</span></a></span><span> </span><span id="local-6989586621679685221"><span class="annot"><span class="annottext">IsRecursive
</span><a href="#local-6989586621679685221"><span class="hs-identifier hs-var">recursive</span></a></span></span><span> </span><span id="local-6989586621679685220"><span class="annot"><span class="annottext">MultiDot
</span><a href="#local-6989586621679685220"><span class="hs-identifier hs-var">multidot</span></a></span></span><span> </span><span id="local-6989586621679685219"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679685219"><span class="hs-identifier hs-var">exts</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-274"></span><span>      </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621679685218"><span class="annot"><span class="annottext">prefix :: String
</span><a href="#local-6989586621679685218"><span class="hs-identifier hs-var hs-var">prefix</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679685227"><span class="hs-identifier hs-var">dir</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; ShowS
</span><a href="../../filepath/src/System.FilePath.Windows.html#%3C%2F%3E"><span class="hs-operator hs-var">&lt;/&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679685222"><span class="hs-identifier hs-var">joinedPrefix</span></a></span><span>
</span><span id="line-275"></span><span>      </span><span id="local-6989586621679685217"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679685217"><span class="hs-identifier hs-var">directoryExists</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">String -&gt; IO Bool
</span><a href="../../directory/src/System.Directory.html#doesDirectoryExist"><span class="hs-identifier hs-var">doesDirectoryExist</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679685218"><span class="hs-identifier hs-var">prefix</span></a></span><span>
</span><span id="line-276"></span><span>      </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679685217"><span class="hs-identifier hs-var">directoryExists</span></a></span><span>
</span><span id="line-277"></span><span>        </span><span class="hs-keyword">then</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-278"></span><span>          </span><span id="local-6989586621679685216"><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679685216"><span class="hs-identifier hs-var">candidates</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">IsRecursive
</span><a href="#local-6989586621679685221"><span class="hs-identifier hs-var">recursive</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-279"></span><span>            </span><span class="annot"><span class="annottext">IsRecursive
</span><a href="Distribution.Simple.Glob.html#Recursive"><span class="hs-identifier hs-var">Recursive</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String -&gt; IO [String]
</span><a href="Distribution.Simple.Utils.html#getDirectoryContentsRecursive"><span class="hs-identifier hs-var">getDirectoryContentsRecursive</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679685218"><span class="hs-identifier hs-var">prefix</span></a></span><span>
</span><span id="line-280"></span><span>            </span><span class="annot"><span class="annottext">IsRecursive
</span><a href="Distribution.Simple.Glob.html#NonRecursive"><span class="hs-identifier hs-var">NonRecursive</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">(String -&gt; IO Bool) -&gt; [String] -&gt; IO [String]
forall (m :: * -&gt; *) a.
Applicative m =&gt;
(a -&gt; m Bool) -&gt; [a] -&gt; m [a]
</span><a href="../../base/src/Control.Monad.html#filterM"><span class="hs-identifier hs-var">filterM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; IO Bool
</span><a href="../../directory/src/System.Directory.html#doesFileExist"><span class="hs-identifier hs-var">doesFileExist</span></a></span><span> </span><span class="annot"><span class="annottext">(String -&gt; IO Bool) -&gt; ShowS -&gt; String -&gt; IO Bool
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679685218"><span class="hs-identifier hs-var">prefix</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; ShowS
</span><a href="../../filepath/src/System.FilePath.Windows.html#%3C%2F%3E"><span class="hs-operator hs-var">&lt;/&gt;</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">([String] -&gt; IO [String]) -&gt; IO [String] -&gt; IO [String]
forall (m :: * -&gt; *) a b. Monad m =&gt; (a -&gt; m b) -&gt; m a -&gt; m b
</span><a href="../../base/src/GHC.Base.html#%3D%3C%3C"><span class="hs-operator hs-var">=&lt;&lt;</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; IO [String]
</span><a href="../../directory/src/System.Directory.html#getDirectoryContents"><span class="hs-identifier hs-var">getDirectoryContents</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679685218"><span class="hs-identifier hs-var">prefix</span></a></span><span>
</span><span id="line-281"></span><span>          </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621679685205"><span class="annot"><span class="annottext">checkName :: String -&gt; Maybe (GlobResult String)
</span><a href="#local-6989586621679685205"><span class="hs-identifier hs-var hs-var">checkName</span></a></span></span><span> </span><span id="local-6989586621679685204"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679685204"><span class="hs-identifier hs-var">candidate</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-282"></span><span>                </span><span class="hs-keyword">let</span><span> </span><span class="hs-special">(</span><span id="local-6989586621679685203"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679685203"><span class="hs-identifier hs-var">candidateBase</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679685202"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679685202"><span class="hs-identifier hs-var">candidateExts</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; (String, String)
</span><a href="../../filepath/src/System.FilePath.Windows.html#splitExtensions"><span class="hs-identifier hs-var">splitExtensions</span></a></span><span> </span><span class="annot"><span class="annottext">(String -&gt; (String, String)) -&gt; String -&gt; (String, String)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">ShowS
</span><a href="../../filepath/src/System.FilePath.Windows.html#takeFileName"><span class="hs-identifier hs-var">takeFileName</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679685204"><span class="hs-identifier hs-var">candidate</span></a></span><span>
</span><span id="line-283"></span><span>                </span><span class="annot"><span class="annottext">Bool -&gt; Maybe ()
forall (f :: * -&gt; *). Alternative f =&gt; Bool -&gt; f ()
</span><a href="../../base/src/Control.Monad.html#guard"><span class="hs-identifier hs-var">guard</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Bool -&gt; Bool
</span><span class="hs-identifier hs-var">not</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; Bool
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#null"><span class="hs-identifier hs-var">null</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679685203"><span class="hs-identifier hs-var">candidateBase</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-284"></span><span>                </span><span id="local-6989586621679685201"><span class="annot"><span class="annottext">GlobResult ()
</span><a href="#local-6989586621679685201"><span class="hs-identifier hs-var">match</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">MultiDot -&gt; String -&gt; String -&gt; Maybe (GlobResult ())
</span><a href="Distribution.Simple.Glob.html#checkExt"><span class="hs-identifier hs-var">checkExt</span></a></span><span> </span><span class="annot"><span class="annottext">MultiDot
</span><a href="#local-6989586621679685220"><span class="hs-identifier hs-var">multidot</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679685219"><span class="hs-identifier hs-var">exts</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679685202"><span class="hs-identifier hs-var">candidateExts</span></a></span><span>
</span><span id="line-285"></span><span>                </span><span class="annot"><span class="annottext">GlobResult String -&gt; Maybe (GlobResult String)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679685222"><span class="hs-identifier hs-var">joinedPrefix</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; ShowS
</span><a href="../../filepath/src/System.FilePath.Windows.html#%3C%2F%3E"><span class="hs-operator hs-var">&lt;/&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679685204"><span class="hs-identifier hs-var">candidate</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; GlobResult () -&gt; GlobResult String
forall (f :: * -&gt; *) a b. Functor f =&gt; a -&gt; f b -&gt; f a
</span><a href="../../base/src/GHC.Base.html#%3C%24"><span class="hs-operator hs-var">&lt;$</span></a></span><span> </span><span class="annot"><span class="annottext">GlobResult ()
</span><a href="#local-6989586621679685201"><span class="hs-identifier hs-var">match</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-286"></span><span>          </span><span class="annot"><span class="annottext">[GlobResult String] -&gt; IO [GlobResult String]
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">([GlobResult String] -&gt; IO [GlobResult String])
-&gt; [GlobResult String] -&gt; IO [GlobResult String]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">(String -&gt; Maybe (GlobResult String))
-&gt; [String] -&gt; [GlobResult String]
forall a b. (a -&gt; Maybe b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/Data.Maybe.html#mapMaybe"><span class="hs-identifier hs-var">mapMaybe</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; Maybe (GlobResult String)
</span><a href="#local-6989586621679685205"><span class="hs-identifier hs-var">checkName</span></a></span><span> </span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679685216"><span class="hs-identifier hs-var">candidates</span></a></span><span>
</span><span id="line-287"></span><span>        </span><span class="hs-keyword">else</span><span>
</span><span id="line-288"></span><span>          </span><span class="annot"><span class="annottext">[GlobResult String] -&gt; IO [GlobResult String]
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">String -&gt; GlobResult String
forall a. String -&gt; GlobResult a
</span><a href="Distribution.Simple.Glob.html#GlobMissingDirectory"><span class="hs-identifier hs-var">GlobMissingDirectory</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679685222"><span class="hs-identifier hs-var">joinedPrefix</span></a></span><span> </span><span class="hs-special">]</span><span>
</span><span id="line-289"></span><span>    </span><span class="annot"><a href="Distribution.Simple.Glob.html#FinalLit"><span class="hs-identifier hs-type">FinalLit</span></a></span><span> </span><span id="local-6989586621679685199"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679685199"><span class="hs-identifier hs-var">fn</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-290"></span><span>      </span><span id="local-6989586621679685198"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679685198"><span class="hs-identifier hs-var">exists</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">String -&gt; IO Bool
</span><a href="../../directory/src/System.Directory.html#doesFileExist"><span class="hs-identifier hs-var">doesFileExist</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679685227"><span class="hs-identifier hs-var">dir</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; ShowS
</span><a href="../../filepath/src/System.FilePath.Windows.html#%3C%2F%3E"><span class="hs-operator hs-var">&lt;/&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679685222"><span class="hs-identifier hs-var">joinedPrefix</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; ShowS
</span><a href="../../filepath/src/System.FilePath.Windows.html#%3C%2F%3E"><span class="hs-operator hs-var">&lt;/&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679685199"><span class="hs-identifier hs-var">fn</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-291"></span><span>      </span><span class="annot"><span class="annottext">[GlobResult String] -&gt; IO [GlobResult String]
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">String -&gt; GlobResult String
forall a. a -&gt; GlobResult a
</span><a href="Distribution.Simple.Glob.html#GlobMatch"><span class="hs-identifier hs-var">GlobMatch</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679685222"><span class="hs-identifier hs-var">joinedPrefix</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; ShowS
</span><a href="../../filepath/src/System.FilePath.Windows.html#%3C%2F%3E"><span class="hs-operator hs-var">&lt;/&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679685199"><span class="hs-identifier hs-var">fn</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679685198"><span class="hs-identifier hs-var">exists</span></a></span><span> </span><span class="hs-special">]</span><span>
</span><span id="line-292"></span><span>
</span><span id="line-293"></span><span id="local-6989586621679685513"><span id="local-6989586621679685514"><span id="local-6989586621679685515"><span class="annot"><a href="Distribution.Simple.Glob.html#unfoldr%27"><span class="hs-identifier hs-type">unfoldr'</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679685515"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/Data.Either.html#Either"><span class="hs-identifier hs-type">Either</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679685514"><span class="hs-identifier hs-type">r</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679685513"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="#local-6989586621679685515"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679685515"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="hs-special">[</span><span class="annot"><a href="#local-6989586621679685513"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="#local-6989586621679685514"><span class="hs-identifier hs-type">r</span></a></span><span class="hs-special">)</span></span></span></span><span>
</span><span id="line-294"></span><span id="unfoldr%27"><span class="annot"><span class="annottext">unfoldr' :: forall a r b. (a -&gt; Either r (b, a)) -&gt; a -&gt; ([b], r)
</span><a href="Distribution.Simple.Glob.html#unfoldr%27"><span class="hs-identifier hs-var hs-var">unfoldr'</span></a></span></span><span> </span><span id="local-6989586621679685196"><span class="annot"><span class="annottext">a -&gt; Either r (b, a)
</span><a href="#local-6989586621679685196"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span id="local-6989586621679685195"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679685195"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">a -&gt; Either r (b, a)
</span><a href="#local-6989586621679685196"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679685195"><span class="hs-identifier hs-var">a</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-295"></span><span>  </span><span class="annot"><a href="../../base/src/Data.Either.html#Left"><span class="hs-identifier hs-type">Left</span></a></span><span> </span><span id="local-6989586621679685194"><span class="annot"><span class="annottext">r
</span><a href="#local-6989586621679685194"><span class="hs-identifier hs-var">r</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">r
</span><a href="#local-6989586621679685194"><span class="hs-identifier hs-var">r</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-296"></span><span>  </span><span class="annot"><a href="../../base/src/Data.Either.html#Right"><span class="hs-identifier hs-type">Right</span></a></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679685193"><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679685193"><span class="hs-identifier hs-var">b</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679685192"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679685192"><span class="hs-identifier hs-var">a'</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">(a -&gt; Either r (b, a)) -&gt; a -&gt; ([b], r)
forall a r b. (a -&gt; Either r (b, a)) -&gt; a -&gt; ([b], r)
</span><a href="Distribution.Simple.Glob.html#unfoldr%27"><span class="hs-identifier hs-var">unfoldr'</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; Either r (b, a)
</span><a href="#local-6989586621679685196"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679685192"><span class="hs-identifier hs-var">a'</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-297"></span><span>    </span><span class="hs-special">(</span><span id="local-6989586621679685191"><span class="annot"><span class="annottext">[b]
</span><a href="#local-6989586621679685191"><span class="hs-identifier hs-var">bs</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679685190"><span class="annot"><span class="annottext">r
</span><a href="#local-6989586621679685190"><span class="hs-identifier hs-var">r</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679685193"><span class="hs-identifier hs-var">b</span></a></span><span> </span><span class="annot"><span class="annottext">b -&gt; [b] -&gt; [b]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span> </span><span class="annot"><span class="annottext">[b]
</span><a href="#local-6989586621679685191"><span class="hs-identifier hs-var">bs</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">r
</span><a href="#local-6989586621679685190"><span class="hs-identifier hs-var">r</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-298"></span><span>
</span><span id="line-299"></span><span class="hs-comment">-- | Extract the (possibly null) constant prefix from the pattern.</span><span>
</span><span id="line-300"></span><span class="hs-comment">-- This has the property that, if @(pref, final) = splitConstantPrefix pat@,</span><span>
</span><span id="line-301"></span><span class="hs-comment">-- then @pat === foldr GlobStem (GlobFinal final) pref@.</span><span>
</span><span id="line-302"></span><span class="annot"><a href="Distribution.Simple.Glob.html#splitConstantPrefix"><span class="hs-identifier hs-type">splitConstantPrefix</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Simple.Glob.html#Glob"><span class="hs-identifier hs-type">Glob</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="hs-special">[</span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Distribution.Simple.Glob.html#GlobFinal"><span class="hs-identifier hs-type">GlobFinal</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-303"></span><span id="splitConstantPrefix"><span class="annot"><span class="annottext">splitConstantPrefix :: Glob -&gt; ([String], GlobFinal)
</span><a href="Distribution.Simple.Glob.html#splitConstantPrefix"><span class="hs-identifier hs-var hs-var">splitConstantPrefix</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Glob -&gt; Either GlobFinal (String, Glob))
-&gt; Glob -&gt; ([String], GlobFinal)
forall a r b. (a -&gt; Either r (b, a)) -&gt; a -&gt; ([b], r)
</span><a href="Distribution.Simple.Glob.html#unfoldr%27"><span class="hs-identifier hs-var">unfoldr'</span></a></span><span> </span><span class="annot"><span class="annottext">Glob -&gt; Either GlobFinal (String, Glob)
</span><a href="#local-6989586621679685189"><span class="hs-identifier hs-var">step</span></a></span><span>
</span><span id="line-304"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-305"></span><span>    </span><span id="local-6989586621679685189"><span class="annot"><span class="annottext">step :: Glob -&gt; Either GlobFinal (String, Glob)
</span><a href="#local-6989586621679685189"><span class="hs-identifier hs-var hs-var">step</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Simple.Glob.html#GlobStem"><span class="hs-identifier hs-type">GlobStem</span></a></span><span> </span><span id="local-6989586621679685188"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679685188"><span class="hs-identifier hs-var">seg</span></a></span></span><span> </span><span id="local-6989586621679685187"><span class="annot"><span class="annottext">Glob
</span><a href="#local-6989586621679685187"><span class="hs-identifier hs-var">pat</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(String, Glob) -&gt; Either GlobFinal (String, Glob)
forall a b. b -&gt; Either a b
</span><a href="../../base/src/Data.Either.html#Right"><span class="hs-identifier hs-var">Right</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679685188"><span class="hs-identifier hs-var">seg</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Glob
</span><a href="#local-6989586621679685187"><span class="hs-identifier hs-var">pat</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-306"></span><span>    </span><span class="annot"><a href="#local-6989586621679685189"><span class="hs-identifier hs-var">step</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Simple.Glob.html#GlobFinal"><span class="hs-identifier hs-type">GlobFinal</span></a></span><span> </span><span id="local-6989586621679685186"><span class="annot"><span class="annottext">GlobFinal
</span><a href="#local-6989586621679685186"><span class="hs-identifier hs-var">pat</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">GlobFinal -&gt; Either GlobFinal (String, Glob)
forall a b. a -&gt; Either a b
</span><a href="../../base/src/Data.Either.html#Left"><span class="hs-identifier hs-var">Left</span></a></span><span> </span><span class="annot"><span class="annottext">GlobFinal
</span><a href="#local-6989586621679685186"><span class="hs-identifier hs-var">pat</span></a></span><span>
</span><span id="line-307"></span></pre></body></html>